In the virtual memory concept, where does C compilers store immediate strings? Example:
char *str = "Immediate string";
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
gccat least handles the following four cases differently:Local variable
char *strand global variablechar *strare stored into the.rodatasection:The storage for local variable
char buf[]is allocated on the stack at runtime, and initialized via instructions in the.textsection:The global variable
char buf[]is stored in the.datasection: