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


Please Help Members By Posting Answers For Below Questions

Explain the difference between new() and malloc() in c++?

851


What is meant by iomanip in c++?

850


What is c++ hash?

849


How does a copy constructor differs from an overloaded assignment operator?

789


Define a constructor?

803


What is the difference between a "copy constructor" and an "assignment operator" in C++?

847


Incase of a function declaration, what is extern means?

729


why and when we can declar member fuction as a private in the class?

1831


What is the difference between a template and a macro?

809


Discussion on error handling of C++ .

860


What is a tree in c++?

740


What is a literal in c++?

762


What is an operator function? Describe the function of an operator function?

866


What are enumerations?

860


What language is a dll written in?

728