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 is the difference between the = symbol and == symbol?

1133


What are the different types of control structures?

1052


What are reserved words with a programming language?

1151


What is 1f in c?

2674


What is time null in c?

1084


main() { printf("hello"); fork(); }

1209


How can you access memory located at a certain address?

1133


What is meant by realloc()?

1169


What does 3 mean in texting?

1119


What is graph in c?

1068


By using C language input a date into it and if it is right?

1091


Why dont c comments nest?

1060


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1071


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1333


What are header files in c?

1093