Hi everybody, can any one help me with this i much appreciate it.
I have at times this problem of not being sure if i have to allocate
memory space for a certain var(usually strings or blocks of memory and at times had become a game of guessing) so i will put these in list below
please if you can tell me in which cases i need to allocate memory either with mallock or calloc.and inwhich i dont need.
case # 1 =Lets say we have a char string nonconstant that we dont know the lenght of it like a directory environmental block or a
structure member
case #2 = a fixed const char string like"hello everybody"
now which of the variables listed below need to allocate memory to point and be able to hold the data for the cases above
Code:
BYTE *ptobyte
PTSTR *ptstr
char *pchar
BUFFER pbuffer
and couple of more types that i forgot and u can tell if u know of.
Now i need to know which one of the above variables need to allocate mem to hold the data for the 2 cases i mentioned earlier?
there are cases that i forget to allocate mem and the program works fine may be the compiler is doing it for me.
thank you in advance