468,457 Members | 1,590 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,457 developers. It's quick & easy.

help me plz

can you all help me....how to do a 5x5 matrix programme?
Aug 18 '06 #1
9 3900
D_C
293 100+
Does this help? Otherwise, you will have to be more specific.
Aug 18 '06 #2
erm...can you give the code to do 5x5 matrix? i didn't really understand about programming.
Aug 19 '06 #3
D_C
293 100+
Is this what you mean by 5x5 matrix?
Expand|Select|Wrap|Line Numbers
  1. #include <iostream.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.   int matrix[5][5] = { 0,1,0,1,2, 1,0,2,0,1, 0,2,0,2,0, 1,0,2,0,1, 2,1,0,1,0 };
  7.  
  8.   for(int j = 0; j < (sizeof matrix)/(sizeof matrix[0]); j++)
  9.   {
  10.     for(int k = 0; k < (sizeof matrix[0])/(sizeof matrix[0][0]); k++)
  11.     {
  12.       cout << matrix[j][k] << " ";
  13.     }
  14.     cout << endl;
  15.   }
  16.  
  17.   system("PAUSE");
  18.   return 0;
  19. }
Aug 19 '06 #4
erm...i already try that code...when compile, success with 5 warnings...when i run the code...there is an error... LINKER WARNING : NO MODULE DEFINITION FILE SPECIFIED :USING DEFAULTS
LINKER ERROR : UNDEFINED SYMBOL_ SYSTEM IN MODULE

what is that all about? i don't understand.
Aug 19 '06 #5
help me plz...i need to send my assignment next week on wednesday...=(
Aug 19 '06 #6
D_C
293 100+
The code works fine for me. It even compiles for you. Other than that, it's likely some part of your set up that is incorrect. I'm using Dev-C++, which is free online, you could download that and see if it works there.

What are the five LINK errors that you get? Is it the undefined symbol error five times?
Aug 19 '06 #7
i'm using turbo c++ 4.5...the 5 links are
Warning MATRIX.CPP 6: Initialization is only partially bracketed in function main()
Warning MATRIX.CPP 6: Initialization is only partially bracketed in function main()
Warning MATRIX.CPP 6: Initialization is only partially bracketed in function main()
Warning MATRIX.CPP 6: Initialization is only partially bracketed in function main()
Warning MATRIX.CPP 6: Initialization is only partially bracketed in function main()

where can i get Dev-C++ ? is it a free software?
Aug 20 '06 #8
D_C
293 100+
Yes it's free: http://www.bloodshed.net/devcpp.html

After Googling the warning, it says you either omitted optional curly braces "{}", or you may have too many curly braces "}" at the end.
Page 192
--------
There is a new compiler warning:
Initialization is only partially bracketed
When structures are initialized, braces can be used to mark the
initialization of each member of the structure. If a member
itself is an array or structure, nested pairs of braces may be
used. This ensures that your idea and the compiler's idea of what
value goes with which member are the same. When some of the
optional braces are omitted, the compiler issues this warning.
Aug 21 '06 #9
Erk...thanks For Ur Help. But I Still Didn't Get The Code For Matrix 5x5...hehe
Aug 22 '06 #10

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Tom | last post: by
6 posts views Thread by wukexin | last post: by
3 posts views Thread by Colin J. Williams | last post: by
7 posts views Thread by Corepaul | last post: by
5 posts views Thread by Steve | last post: by
8 posts views Thread by Mark | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.