Question: 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,

1. Do I need to allocate memory for every variable, before storing data into them?
2. Is there any special case when I do not need to allocate memory for them? for this I know one for `char` pointer,
`strdup()` which allocate memory itself, we have not to care much about it.
3. Any further suggestions are welcome.

Answer: 
Pointers point at things. It's up to you what you make them point at.

* You can leave them uninitialized and don't use them: `int * q;` That's a little silly.
* You can make them point to something that exists: `int x; int * q = &x;`
* You can store the address of dynamically allocated memory in them: `int * q = malloc(29);`
I think that in C, a variable is a pointer added \* with a memory. And a pure pointer has no memory. So if we want to store a data, we need to give the pointer a memory.
Sure, there are many ways to assign the memory.

First:

```
uint32_t x;
uint32_t *p = &x;
uint32_t array[10];
uint32_t *q = array;// equals to int *q = &array[0];

```

Second:

```
#define NUM_MACRO   ((uint32_t) 10)
//we must free after we using. Or, perhaps we we will get a segment fault.
uint32_t *p = malloc(size(uint32_t) * NUM_MACRO); 

```