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 the size of enum in c?
What are the different types of data structures in c?
What is bubble sort in c?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
Why we not create function inside function.
What are the back slash character constants or escape sequence charactersavailable in c?
Is c pass by value or reference?
What are different types of variables in c?
What is structure in c explain with example?
What is d'n in c?
Difference between linking and loading?
What is a function simple definition?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is the meaning of typedef struct in c?
Wt are the Buses in C Language