Possible Duplicate:
C String literals: Where do they go?
As far as I know,
generally, pointer have to be allocated by malloc(), and will be allocated to heap, then unallocated by free();
and
non pointer(int,char,float,etc..) will be allocated automatically to stack, and unallocated as long as the function go to return
but, from following code :
#include <stdio.h> int main() { char *a; a = "tesaja"; return 0; } where will a allocated to ? stack or heap ?