Can a string be represented by an array of symbol? True or False
Answers
Answered by
12
True. A string can be represented by an array of symbols.
Explanation :
- In C language the string is represented as an array of characters because C language does not support strings as a data type.
- Every sequence of characters are terminated by a null character, represented by '\0', which is automatically added by the compiler.
- To define a sequence of characters, the array should must be assigned with size greater than or equal to the characters going to be included. Else, it will become an illegal initialization.
- Examples of valid initialization are :
char name[13] = "Happiestlife";
char name[10] = {'l', 'i' ,'f' ,'e' ,'c' ,'o' ,'l' ,'o' ,'r' ,'\0'};
Learn more :
- What is array in C++
https://brainly.in/question/1849908
- WAP TO STORE 10 NUMBERS IN A ARRAY A[] ABD 5 NUMBERS IN A ARRAY B[] AND THEN MERGE INTO ARRAY C []
https://brainly.in/question/16360859
Answered by
3
answer is True .......101%
Similar questions