Print each element of the array together with their memory addresses

#include <stdio.h>
const int MAX = 6;
const int LEN = 10;
 
int main()
{
    int i,j;
 
    /*Define and Initialize the 2-D array*/
    char language[MAX][LEN]={
          "FORTRAN",
          "BASIC",
          "COBOL",
          "Pascal",
          "C",
          "Ada"
    };
  /*Print*/
  for(i=0;i<MAX;i++)
  {
        printf("n%pt",&language[i][0]);
        for(j=0;language[i][j];j++)
              printf("%c",language[i][j]);
  }
  return 0;
}

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.