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

How do I get an accurate error status return from system on ms-dos?

1130


What does the function toupper() do?

1130


How the c program is executed?

1159


What is the purpose of realloc()?

1146


Explain the process of converting a Tree into a Binary Tree.

2669


What is a constant and types of constants in c?

1135


Is file a keyword in c?

935


Is this program statement valid? INT = 10.50;

1157


Differentiate between the expression “++a” and “a++”?

1253


What is the function of this pointer?

1345


How is actual parameter different from the formal parameter?

1026


What are compound statements?

1179


application attempts to perform an operation?

1978


What is calloc in c?

1145


What are the disadvantages of a shell structure?

1355