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

What is extern keyword in c?

1187


Explain how are portions of a program disabled in demo versions?

1173


What does emoji p mean?

1205


Explain how do you generate random numbers in c?

1133


Explain how can I open a file so that other programs can update it at the same time?

1184


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

1144


What are the different types of errors?

1208


What are pointers in C? Give an example where to illustrate their significance.

1272


What is derived datatype in c?

1145


Why use int main instead of void main?

1180


How do you determine a file’s attributes?

1134


What is a pointer and how it is initialized?

1233


Explain how are 16- and 32-bit numbers stored?

1308


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

1137


What are 'near' and 'far' pointers?

1093