L
lasek
Hi...i'm writing from Rome...and i don't know english very well so...
Only simple question, which is the difference between those two parts of
code.
[FIRST]
int *pInt=NULL;
int iVar=10;
pInt=&iVar;
[SECOND]
int *pInt=NULL;
int iVar=10;
pInt=(int*)malloc(1*sizeof(int));
pInt=&iVar;
I really need to allocate memory before assign an address to a pointer
variable?.
Thus because i know that declaration not allocate memory for pointer
variable.
Is correct ?.
Thanks all..
Only simple question, which is the difference between those two parts of
code.
[FIRST]
int *pInt=NULL;
int iVar=10;
pInt=&iVar;
[SECOND]
int *pInt=NULL;
int iVar=10;
pInt=(int*)malloc(1*sizeof(int));
pInt=&iVar;
I really need to allocate memory before assign an address to a pointer
variable?.
Thus because i know that declaration not allocate memory for pointer
variable.
Is correct ?.
Thanks all..