388 views

1 Answer

0 votes
0 votes
String in C is defined as constant and it gets  memory in the data section of the code. Whenever you execute your program ,then the string is taken as a constant value and any modification to it throws an error.

String can be defined as an array of character, so you access individual character using pointer.
edited by

Related questions

1 votes
1 votes
2 answers
1
1 votes
1 votes
1 answer
2
anonymous asked Jun 17, 2017
476 views
1 votes
1 votes
1 answer
4
Abhisek Saha asked Nov 15, 2017
710 views
What will be the output ?#include<stdio.h>int main(){ char *str1 = "xyz"; char *str2 = "xyz"; if(str1 == str2) printf("equal"); else printf("une...