What is the difference between Char a[ ]=”string” and char
*a=”String”
Answer Posted / vincy
the syntax for a character variable is wrong if we use a
pointer variable as given above that is char*a="string". so
i think the first one is right.we know that the pointer
variable points to the value in the particular address, then
it should not the "string" but "&string".
Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
How static variables and local variablesare similar and dissimilar?
What is the protected keyword used for?
What is a multiset c++?
What are vectors used for in c++?
What is the difference between the functions memmove() and memcpy()?
What do you mean by persistent and non persistent objects?
Write a short code using c++ to print out all odd number from 1 to 100 using a for loop
what do you mean by volatile variable?
Explain about vectors in c ++?
What is size of string in c++?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
What is a unnitialised pointer?
What language is a dll written in?
Explain terminate() function?
How do I get good at c++ programming?