sometimes we use this type of code in our c programming.
char *p = "Sam";
Here the address of constant character string “Sam” is going to be stored in char pointer p. now here
i want to ask where the Sam is going to be stored ?
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.
The standard doesn’t specify this. Typically the string literal (
"Sam") will be stored in the data section, in a read-only page.As for
pitself, it depends on whether it is automatic or static.