edited by
749 views
2 votes
2 votes
void main() {
    char *p="cprogramming";
}

I know the string literal "cprogramming" is stored in read only data segment. But where will the pointer p be stored, in stack or read-write data segment ?

edited by

1 Answer

0 votes
0 votes
Different compilers do it in different ways. So, it depends on the compiler that you are using.

Related questions

0 votes
0 votes
1 answer
2
LavTheRawkstar asked Jan 12, 2017
835 views
INSERTION-SORT (A, n) ⊳ A[1 . . n]for (j ← 2 to len(A) ){key ← A[ j];i ← j – 1 ; while (i 0 and A[i] key) { A[...
1 votes
1 votes
0 answers
3
Reshu $ingh asked Jan 20, 2019
295 views
Are Call by Value and Pass by Value synonyms?What are the differences between Pass by Value and Pass by Reference?Please explain with examples.