top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to declare 2-D array without use row or column in c?

+1 vote

declare only like arr[10] but here arr[10] is 2-D

posted Jul 4, 2017 by Ajay Kumar

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

See the following two program

int main()
  int a[][5] = { 1}; 
  printf("%d", sizeof(a)); 

Output: 20

int main()
  int a[2][5] = { 1}; 
  printf("%d", sizeof(a)); 

Output: 40

Can someone explain the logic why there is such difference of the size?

+3 votes

e.g. Suppose I enter a string : Ram and Shyam likes Ramesh then the output should be Ramesh and Shyam likes Ram.
Here first word Ram is swapped with Ramesh .

+2 votes

I need to get value from the below table

{  {1,25,{45,6,4},5,8,{10,15},1,4,0,0},    

first index is fixed to 3 and in each index no of elements fixed to 10, but inside of some index no of elements is not fixed ... so how can i get this value. how to declare it .

I did like array_x[3][10][];

but its not working .. please suggest

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.