• Post Reply Bookmark Topic Watch Topic
  • New Topic

int []c[] = new int [4][6]; is it a correct syntax ?  RSS feed

 
vinayak jog
Ranch Hand
Posts: 83
MySQL Database Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
int []c[] = new int [4][6]; is it a correct syntax ?
 
Harsha Smith
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes

int [][]c = new int [4][6];//correct

int c[][] = new int [4][6];//correct

int c[][] = new int [4][];//correct

int c [][] = new int [][6];//compilation fails

 
Matthew Brown
Bartender
Posts: 4568
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that there's a difference between "correct" and "sensible". While it compiles, you really shouldn't use that style!
 
vinayak jog
Ranch Hand
Posts: 83
MySQL Database Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the useful guidance !!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!