≡ Menu

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
{ 0 comments… add one }

Leave a Comment