Questions from a "dummy" - page 19

 
Please explain the meaning of the line ((m_patterns_usage&(((int)1)<<p))!=0) ?
 
_____Life_Line:
Please explain the meaning of the string ((m_patterns_usage&(((int)1)<< p))!=0) ?

The meaning of the line is checking the p-th bit of the m_patterns_usage variable for equality to 1 (more exactly, for non-zero).

Read more:

((int) 1) : means to convert the unit to int type to prevent the compiler from automatically converting it to the minimum integer type (char).

((int)1)<< p : means a bit shift of a unit of int type p bits to the left.

(m_patterns_usage & (((int)1)<<p) : bitwise operation And. It will result in a 0 if at least one of the result bits is not equal to one.

You may study the results of bitwise "&" and "|" operations by yourself from reference books. You cannot do without it if you want to continue programming.

 
What might you need to deinitialise variables for?
 
Silent:
Why would you need to deinitialize variables?

If you explain HOW it's done, I'll think of a reasonable use, if I have the slightest chance. ;)

There is no need to deinitialize variables, but it is very desirable to free memory referenced by pointers (dynamically created objects). Always.

 
MetaDriver:

If you can explain HOW it's done, I'll be sure to think of a reasonable use, if there's the slightest chance. ;)

There is no need to deinitialize variables, but it is very desirable to free memory referenced by pointers (dynamically created objects). Always.

string s2=NULL;               // деинициализация строки

From here

But I'd like to know why. Just in case.

And the objects don't have to be deinitialized forcibly, the terminal does it itself before deleting?

 
Silent:

from here

It's in the string conversion. Maybe you mean just assigning an empty value?
 
Silent:
This is in the string conversion. Maybe you mean just assigning an empty value?
I think so too.
 
Hello, how do I change cursor mode in the editor? I'm always in bold and it erases characters when I press the spacebar, how do I switch to normal...?
 
Diubakin:
Hello, how do I change cursor mode in the editor? I'm always in bold and it erases characters when I press the space bar, how do I switch to normal...?
Press the Insert key.
 
Thank you