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...

main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Find the Outputs?

Answer Posted / chappa

The first increment is incorrect, since it will try to
increment the value of 'R' but will end up giving
Segmentation fault.

Second ptr++ is valid as it will shift the pointer from 'R'
to 'a'. The second print statement would have printed "amco
Systems", the compiler gives Seg fault due to the previous
incorrect increment.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 organizational structures?

984


Why do we use int main?

1054


What is sizeof return in c?

1000


in iso what are the common technological language?

2061


what is reason of your company position's in india no. 1.

2254


What are the keywords in c?

1089


List some of the static data structures in C?

1166


in linking some of os executables are linking name some of them

2085


write a program to find out prime number using sieve case?

2050


what is the height of tree if leaf node is at level 3. please explain

2102


What is the usage of the pointer in c?

1063


What is a node in c?

934


What is the function of this pointer?

1243


What is difference between structure and union with example?

1014


What are shell structures used for?

994