okay a pointer is a variable that points to another variable address ..right ??.
i have written thids code and it allocats 1 char right that means 1 byte
I allocated 1 byte space to pointer sp then it shoudl only contain d ??? Okay first of all a pointer is a varible so if i use molloc to allocate space i can use it as a variable or if i dont allocate space i can use it as a pointer ??Code:#include <stdio.h> #include <stdlib.h> int main() { char *sp; sp = malloc(1); strcpy(sp, "datainjector" ); puts(sp); free(sp); system("PAUSE"); return 0; }