Results 1 to 7 of 7

Thread: error with array

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2017
    Posts
    5

    Default error with array

    Hi guys so this part of code is to display 2d array . The first 2 arrays are working great but the last one which is the one post is not working and I can't find out why !! I will post the output also so u can see the problem . thx for ur help .



    Qt Code:
    1. int V [][12] = {0};
    2.  
    3. int colm = 5 , row = 12;
    4.  
    5. cout<<" V area is :\n"
    6. <<"----------------\n\n";
    7.  
    8. for( int i = 0; i < colm ; ++i ) {
    9.  
    10. for (int k = 0 ; k < row ; ++k) {
    11.  
    12. cout<< V [5][12];
    13. }
    14. cout<<endl;
    15. }
    16. cout<<"\n";
    17. }
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. V Area :
    2. ------------------
    3. 151515151515151515151515
    4. 151515151515151515151515
    5. 151515151515151515151515
    6. 151515151515151515151515
    7. 151515151515151515151515
    To copy to clipboard, switch view to plain text mode 
    Last edited by cooka; 16th May 2017 at 16:36.

Similar Threads

  1. Array error: Don't know how to fix it.
    By robgeek in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2016, 02:54
  2. How to parse nested JSON Array and Object inside array
    By Radhika in forum General Programming
    Replies: 5
    Last Post: 17th December 2015, 08:42
  3. How to catch out of range array crashed error?
    By binary001 in forum Newbie
    Replies: 1
    Last Post: 10th October 2015, 18:12
  4. Replies: 0
    Last Post: 9th August 2011, 10:15
  5. Replies: 2
    Last Post: 12th November 2010, 14:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.