What is the difference between char a[] = "string"; and
char *p = "string"; ?

Answer Posted / man

a[] = "string"; is constant pointer to constant string
char *p = "string"; is pointer to constant string

Is This Answer Correct ?    4 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why doesnt long int work?

606


How do you view the path?

656


What is structure pointer in c?

565


What is the 'named constructor idiom'?

635


What is the role of && operator in a program code?

564






How can you pass an array to a function by value?

597


What does sizeof return c?

596


What is structure packing in c?

601


What is a ternary operator in c?

646


I came across some code that puts a (void) cast before each call to printf. Why?

671


How can I determine whether a machines byte order is big-endian or little-endian?

615


What does c mean in basketball?

557


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

631


What is the use of sizeof () in c?

551


Explain what are run-time errors?

603