what is difference between array of characters and string
Answer Posted / kapil kumar verma iimt meerut
when we declare array of char it has to be terminated by
null but termination by null in case of string is
automatic.the compiler automatically puts a null char when
we insert a string for example "kapil" for the
string "kapil\0", but for a char array we need assign a
place for it for example a[6] contains five char & a null
char.& secondly
when char array is read through scanf() input function then
spaces are not allowed if characters is read as string
(through gets() function) spaces are allowedand are treated
as a single char.
| Is This Answer Correct ? | 38 Yes | 4 No |
Post New Answer View All Answers
What is zero based addressing?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
What does *p++ do?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
What is the use of #define preprocessor in c?
What are variables c?
What is the best way of making my program efficient?
What are static variables in c?
What is a string?
What is the value of c?
What is the use of extern in c?
What is difference between static and global variable in c?
What is 'bus error'?
int i=10; printf("%d %d %d", i, i=20, i);