Memory Layout In C

Basically, memory layout of C program contains five segments these are the stack segment, heap segment, BSS (block started by symbol), DS (Data segment) and text segment. Each segment has own read, write and executable permission. If a program tries to access the memory in a way that is not allowed then segmentation fault occurs….

pointers as member

A pointer could be a member of structure, but you should be careful before creating the pointer as member of structure in C. Generally we take a pointer as a member when we don’t know the length of the data which need to store. Let’s see an example to the better understanding,

The above…

pointer to string array in c

In my previous article, I had described the array in brief but I have received some email from the subscriber and they want me to write an article on string array in C. If you want to read the array, you can see my article brief introduction of the array. We can create the string array…