Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

printing an 2d array by row

 
Ryan Perlman
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thougth I was doing it right but with my output it is not I know I am making just one little mistake. please point me to the right spot..
here the code:

------------------
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ryan,
Common programming mistake. Get used to using braces for loops because it is the safest approach.
Your loop (compiler supplied braces):

What you really want:

Little things mean a lot,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic