PDA

View Full Version : I really need urgent help on this: i need this 2D array program [C/C++] please help



Dove
12-08-2011, 04:16 AM
Write the pseudocode (algorithm) for the following program definition: A text file contains 100 characters that you will read into a square array of characters size 10x10 (this will be a 2D array of characters, not strings - you will need to read character by character). The program will call one user-defined function to determine if all the characters on the main diagonal (top-left to bottom-right) are the same.

The function is called checkdiag (header/prototype: int checkdiag (char matrix[][10])) and will return 1 if all the characters on the main diagonal are the same and 0 otherwise.

Your program will read the array from the file, check the diagonal and print a report printing the array and the status of the diagonal. A typical report would look like

a b c d e f g h i j
b a c d e f g h i j
b a a d e f g h i j
b a c a e f g h i j
b a c d a f g h i j
b a c d e a g h i j
b a c d e f a h i j
b a c d e f g a i j
b a c d e f g h a j
b a c d e f g h i a
All the characters on the main diagonal are the same.

Dove
12-08-2011, 04:18 AM
By Thursday night i need it.........i dont know how to do this..

sankarcssn
12-08-2011, 02:03 PM
Is it Okey for you if it is done on UNIX platform ?
If so it is a very small piece of program to achieve your requirement


= sankarcs

Dove
12-08-2011, 03:08 PM
hi sankarcs

it would be nice if it in windows based..