what is the difference between these initializations?
Char a[]=”string”;
Char *p=”literal”;
Does *p++ increment p, or what it points to?

Answer Posted / vignesh1988i

surely there is some difference.....

here 'a' is represented as array in which string gets stored
in consecutive locations......

p is a pointer variable where string is initilized... so in
p the base address of "literal " will get stored......

*p++ increments 'p' , but pertaining to some conditions.....
++ has more precedence than * , so first it will increment
the address and correspondingly it will show the value as *
precedes..... so after the increment the p points to 'i'...



thank u

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between ordinary variable and pointer in c.

725


Why is main function so important?

713


What is a function simple definition?

727


how do you programme Carrier Sense Multiple Access

1602


What does the && operator do in a program code?

812






What is #define?

684


What is printf () in c?

669


Explain about C function prototype?

702


How can variables be characterized?

1783


What are local static variables? How can you use them?

734


What are the different types of control structures?

677


What is the use of getch ()?

727


What are control structures? What are the different types?

694


Should I learn c before c++?

801


What is typedf?

752