Well, I am new to C. I would like to know as my title says.
Suppose I declare pointers as following,
char *chptr1;
char **chptr2;
int *i;
int **ii;
struct somestruct *structvar1;
struct somestruct **structvar2;
Then,
- Do I need to allocate memory for every variable, before storing data into them?
- Is there any special case when I do not need to allocate memory for them? for this I know one for
charpointer,strdup()which allocate memory itself, we have not to care much about it. - Any further suggestions are welcome.