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

Which command is more efficient?
*(ptr+1) or ptr[1]

Answer Posted / poornima

If ptr is declared as a pointer like int *ptr; *(ptr+1) is
more efficient.
If ptr is declared as an array like int ptr[20]; ptr[1] is
more efficient.
So, it depends upon how we r declaring ptr as a pointer or
as an array.

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a void pointer point to a function?

969


Why should I prototype a function?

1119


Define circular linked list.

975


What is %lu in c?

1176


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1094


What is c basic?

1123


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1921


Differentiate between a structure and a union.

1226


What is the significance of an algorithm to C programming?

994


Explain how can I manipulate strings of multibyte characters?

1156


how could explain about job profile

1856


What is the correct code to have following output in c using nested for loop?

1026


Explain 'far' and 'near' pointers in c.

1080


Explain what is a const pointer?

1035


Discuss the function of conditional operator, size of operator and comma operator with examples.

1094