Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / gaurav

I am totally satisfied with your above explanation except
last one.
i.e. Char *p="literal";
So, i want to mention yes this will work.
Explanation: *p++.
Here we have post increment.
Postfix increment/decrement have high precedence, but the
actual increment or decrement of the operand is delayed (to
be accomplished sometime before the statement completes
execution).
value of printf("\nstr=%c\n",*p++) will be 'l', but before
complete execution of this statement p will point to string
"iteral" as p got incremented.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c programing language?

1047


Explain what is a static function?

1050


Is a house a mass structure?

1054


#include { printf("Hello"); } how compile time affects when we add additional header file .

1856


number of times a digit is present in a number

1989


Can you mix old-style and new-style function syntax?

1052


Where can I get an ansi-compatible lint?

1100


Is void a keyword in c?

927


Are enumerations really portable?

983


Should I learn data structures in c or python?

978


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2369


What are the advantages of using macro in c language?

1072


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1157


How many levels of indirection in pointers can you have in a single declaration?

1029


Why isn't any of this standardized in c? Any real program has to do some of these things.

1152