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 advantages of using friend classes.

814


What is a dll entry point?

725


What's the order in which the local objects are destructed?

998


What is meant by entry controlled loop? What all C++ loops are exit controlled?

803


What are the differences between new and malloc?

798






Write a program which uses Command Line Arguments

829


What does it mean to declare a member variable as static?

793


What are c++ variables?

754


What is the purpose of ios::basefield in the following statement?

1001


What is the purpose of the "delete" operator?

795


What is a node class in c++?

806


What is the default access level?

794


What is the difference between interpreters and compilers?

821


What is atoi?

721


How static variables and local variablesare similar and dissimilar?

776