expression must have integral type

I get that compilation error because of this line which intended to increase the pointer by 0x200 (to point to the next segment) I’v seen this but I didn’t use any illegal symbol! P.S. The initialization of the pointer:

When should I use the new keyword in C++?

Method 1 (using new) Allocates memory for the object on the free store (This is frequently the same thing as the heap) Requires you to explicitly delete your object later. (If you don’t delete it, you could create a memory leak) Memory stays allocated until you delete it. (i.e. you could return an object that you created using new) The example in the question will leak memory unless … Read more

What’s the difference between char and char* in C++?

The variables with the * are pointers. A ‘normal’ variable, for example a char or an int, contains the value of that datatype itself – the variable can hold a character, or an integer. A pointer is a special kind of variable; it doesn’t hold the value itself, it contains the address of a value in memory. … Read more

Why does the arrow (->) operator in C exist?

I’ll interpret your question as two questions: 1) why -> even exists, and 2) why . does not automatically dereference the pointer. Answers to both questions have historical roots. Why does -> even exist? In one of the very first versions of C language (which I will refer as CRM for “C Reference Manual“, which came with 6th Edition Unix in … Read more

how does the ampersand(&) sign work in c++?

To start, note that is a special pointer ( == memory address) to the class its in. First, an object is instantiated: Next, a pointer is instantiated: Next, the memory address of a is assigned to the pointer b: Next, the method CDummy::isitme(CDummy &param) is called: A test is evaluated inside this method: Here’s the tricky part. param is an … Read more