+ 5
What is the difference between string & character array?
9 Réponses
+ 5
The difference between character array & string is ,the string ended with a '\0' but incase of character array there are no null point is available. String is a type of character array.
+ 3
In C language, a string is an array of char, these terms all refer to the same thing. In C++ however, a string is a template class instance. Although internally C++ string uses char array as buffer, C++ string is not a mere char array.
Hth, cmiiw
+ 3
String is define as array of characters and end with null.
+ 3
Char holds a single character, while strings holds lots of characters and ends with '\0'
+ 3
INDRAJIT BANERJEE if u goes deeply string is nothing it's a sequence of character when u talk about string mean u have some character then we stored in our mind like hello name e.t.c but string in computer we store group of some character who's termination is \0(null character) .but what does mean character array character array simply a array of char data type .u can store individual character if u want to store string it behave like a string and if u want indivisual store character u can store but in string data type u can store a particular string I hope u get it.
+ 2
String array example,
String[ ] text = {"Indrajit Bannerjee", "Arya deep"};
Basically, String data type can be reffer as words.
This was an example of string array.
Character array example,
Char[ ] word = {'I', 'B', 'A'};
Basically, Charcter data type can be reffer as letters.
This was an example of charcter array.
I hope this helps......!☺☺
0
what is difference between character array and string in c
- 3
The obvious difference is that char array is mutable unlike string, so you can change characters in char array, unlike for list.