0 votes 0 votes closed with the note: duplicate of question : https://gateoverflow.in/75183/madeeasy-test-series What is the output of this C code? Programming in C programming-in-c output pointers + – vaishali jhalani asked Nov 9, 2016 • closed Nov 9, 2016 by Habibkhan vaishali jhalani 549 views comment Share Follow See all 7 Comments See all 7 7 Comments reply Show 4 previous comments Prashant. commented Nov 9, 2016 reply Follow Share "Using pointers we can access any particular location of an array but we can not change that location" Thats correct we cannot change base address of an array .i.e. char p[]= "abc"; here we cant change base addrees of array. and when string stores as char *p= "abc"; then we cannot change element of this string. 0 votes 0 votes vaishali jhalani commented Nov 9, 2016 reply Follow Share Can you explain it with some example? 0 votes 0 votes Prashant. commented Nov 9, 2016 reply Follow Share 1. char *p= "abc"; is called as string constant means when string stored as char *p= "abc" , then we cannot update any character in given strings. i.e. string stored in read only area. so its generate error. 2. char p[]= "abc"; simple array contain string abc so here by using base address and index value we can change any character assume base address =100 i.e. *(100 +1)=d then array look like adc .but here we cannot change the base address of array i.e. if we do p = 1000 then we lost array elements and may be 1000 location assign to some other variable. so it gives error. reffer : http://www.geeksforgeeks.org/storage-for-strings-in-c/ 1 votes 1 votes Please log in or register to add a comment.