N
Nagrik
Dear Group,
I understand that if the literal string is bound to a variable then it
goes in a special place in the memory and remains with the program
till the end and its characters can not be manipulated. But however
the following example. Will the literal string (returned to variable
retval from function retstr) will remain with the program forever in
the following examples.
#include <stdio.h>
char* retstr();
char* retstr() { return "literalstring";}
int main() {
char* retval = retstr();
return 0;
}
Thanks for your help.
nagrik
I understand that if the literal string is bound to a variable then it
goes in a special place in the memory and remains with the program
till the end and its characters can not be manipulated. But however
the following example. Will the literal string (returned to variable
retval from function retstr) will remain with the program forever in
the following examples.
#include <stdio.h>
char* retstr();
char* retstr() { return "literalstring";}
int main() {
char* retval = retstr();
return 0;
}
Thanks for your help.
nagrik