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 / bee

logically, both are treated as array of characters(i.e.
string) but....

1) a is an array of characters(a string)

2) p is a pointer to an array of characters
the statement char *p = "literal" is equivalent to
char j[] = "literal"
char *p = j;
3) *p++ can be seen as *(p++)....
this is so because '++' has higher recedence over '*'
operator. so, it increments address by 1 unit and prints
the corresponding value value

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is New modifiers?

1080


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

1056


what are bit fields in c?

1611


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3485


What is the purpose of 'register' keyword in c language?

988


write a program to generate address labels using structures?

4532


What is multidimensional arrays

1076


How was c created?

1003


Which is the memory area not included in C program? give the reason

1903


what is event driven software and what is procedural driven software?

2516


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1049


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

1055


What are the different properties of variable number of arguments?

1117


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

2158


What are the salient features of c languages?

1057