What are the two common ways of selecting array elements for processing - counter
Sponsored Links


Popular Links


List of Abbreviations

National Highways in India

States & Union Territories of India

Currency of All Countries

What are the two common ways of selecting array elements for processing

You are Here: Home > Computer Subjects > Programming in C Language > …

What are the two common ways of selecting array elements for processing.

Ans.

  • One way is to select elements by array index:
          int a[10];
          printf("%d", a[7]);   //using array index
  • Another way is to select elements by pointer:
          int a[10];
          printf("%d", *(a+7));   //using pointer
Updated: May 31, 2013 — 2:05 pm

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2016. All Rights Reserved. WikiIND.com