My question is: why is there a "--p", from what I understand the "++p"function serves to climb a number of imaginary array pointer, but the "--p" is for that? I realized that without it the code letters are not shown but did not understand how this works. thanks and even more
code :
#include <stdio.h>
using namespace std;
int main()
{
char* p = new char [12];
*p=0x48;
++p;
*p=0x65;
++p;
*p=0x6c;
++p;
*p=0x6c;
++p;
*p=0x6f;
++p;
*p=0x20;
++p;
*p=0x57;
++p;
*p=0x6f;
++p;
*p=0x72;
++p;
*p=0x6c;
++p;
*p=0x64;
++p;
*p=0x0;
++p;
--p;
--p;
--p;
--p;
--p;
--p;
--p;
--p;
--p;
--p;
--p;
--p;
printf(p);
delete p;
return 0 ;
}