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
Why enum is used in c?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Wt are the Buses in C Language
What is a const pointer in c?
When do we get logical errors?
write a program to rearrange the array such way that all even elements should come first and next come odd
Why is c called "mother" language?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
write a program fibonacci series and palindrome program in c
Is that possible to add pointers to each other?
Explain what is gets() function?
Is malloc memset faster than calloc?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
What is difference between union and structure in c?