Interview Questions and Answers :: Ciena
Home > Experience Archives > Ciena > Interview Question Set 1 > Discussion
8. What is difference in the below
char *p = "ciena"
char ar[] = "ciena"
Answer:
Char Pointer p is pointing to char string which is stored in code segment so that it can not change due to read only memory location but in second statement char array is stored in stack segment which can be modified during run time.
Shishupal
13 Jul, 2021 1:46 PM
Char Pointer p is pointing to char string which is stored in code segment so that it can not change due to read only memory location but in second statement char array is stored in stack segment which can be modified during run time.
Report Error
Report Error
Please Login First Click Here