diff options
Diffstat (limited to '26_tests_matrix_input/next-README')
-rw-r--r-- | 26_tests_matrix_input/next-README | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/26_tests_matrix_input/next-README b/26_tests_matrix_input/next-README new file mode 100644 index 0000000..3484c1a --- /dev/null +++ b/26_tests_matrix_input/next-README @@ -0,0 +1,46 @@ +In a previous function, you write a function + + void rotate(char matrix[10][10]) + +which performed 90 degree clockwise rotation of a 10x10 +matrix. In that assignment, we gave you a compiled +object file which read the input matrix from a file, +called your function to do the rotation, and then +printed the result to the screen. + +In this assignment, you will write the code that we +previously gave you, making the complete program on your own. +You are encouraged to make use of your previously written +rotate function in this assignment. + +For this problem, you will be writing a program which +performs a 90 degree clockwise rotation of a 10x10 matrix. +There is nothing special about a 10x10 matrix---I just need +to fix the matrix size, since we have not learned about dynamic +memory allocation yet, so we do not have the knowledge needed +to read in any size of matrix. + +To keep the input processing simple, the matrix will be a matrix +of characters (so you will have something like + char matrix[10][10] +in your program), which will be read from a file. Each line +in the input file should contain 10 characters (plus a newline). + +Requirements: +============= + - Create a file called rotateMatrix.c + - Your program will take one command line argument, a string + specifying the input file to read. + - The input file should contain 10 lines, each of which + have 10 (non-newline) characters (plus a newline). + - Your program should then rotate this 90 degrees clockwise, + and print the result on stdout. + Note that sample.txt provides sample input, and + sample.out provides sample output. + - If there are any errors, your program should print an + appropriate message to stderr, and exit with EXIT_FAILURE. + +Hints: +------ + - You may find the strchr useful for error checking that + you read a proper line (10 non-newline characters, then a newline). |