Yes Jos I agree and often I use the literals..that is the reason I want to know how and when the literals are cleaned up or they simply keep filling data segment??
Thanks
Sam
User Profile
Collapse
-
Memory allocation to a char *
Hi,
How is memory allocated handled in C++ in following case:
int main ()
{
char * s = "Hello"; //line 1
s= "World"; //line 2
s = new char[10]; //line 3
delete[] s; //line 4
}
After assigning "Hello" to s in first line when s is reassigned with "World"
1....
No activity results to display
Show More
Leave a comment: