Pages

Find Size of (unsized) dynamic Array and print element of Array

Friday 19 April 2013



#include <stdio.h>
#include <conio.h>
main()
{
      int i, j;
     char str1[][2]={
     '1', 'a',
     '2', 'b',
     '3', 'c',
     '4', 'd',
     '5', 'e',
     '6', 'f'};
     printf("Size of Array is: %d \n\n", sizeof(str1));
     printf("Element of Array is: \n");
     for(i=0; i<=5; i++)
     {
     for(j=0; j<=1; j++)
     {
         printf("%c \t", str1[i][j]);  
     }
     printf("\n");
     }
 
     getch();
}

 

Search Box

Most Reading

Contact Form

Name

Email *

Message *