Go through the following code sinippet
char a[20];
a="Hello Orcale Test";
will this compile?
Answer Posted / vignesh1988i
the above variable 'a' is a character array , so i would not been wrong if it has been initilized on the same line.....
but they have done that in the next line , there lies the mistake... THIS PROGRAM WILL GIVE AN ERROR why because we cant copy the entire string in a single travel by using '='(assignment) operator unless it's an initilization directly/.....
thank u
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why is structure padding done in c?
What is type qualifiers?
What are the advantages and disadvantages of a heap?
Can we initialize extern variable in c?
Why does this code crash?
write a program to copy the string using switch case?
What should malloc(0) do?
What is the purpose of void pointer?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
what is use of malloc and calloc?
Explain about the functions strcat() and strcmp()?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
What is a 'null pointer assignment' error?
Is python a c language?
What is #include called?