diff --git a/assignment.c b/assignment.c index 25a15d0..5e99251 100644 --- a/assignment.c +++ b/assignment.c @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) { int rows = atoi(argv[1]); int cols = atoi(argv[2]); - if (rows != 5 || cols != 10) { // Ensure the dimensions match the test expectations + if (rows != 5 || cols != 10) { printf("Incorrect usage. Expected dimensions are 5 rows and 10 columns\n"); return 1; } diff --git a/test.c b/test.c index c6c7b65..e644048 100644 --- a/test.c +++ b/test.c @@ -7,7 +7,6 @@ #define NCOLS 10 int main(int argc, char *argv[]) { - // testing ./assignment NROWS NCOLS FILE *f; char line[256]; char *token; @@ -19,14 +18,11 @@ int main(int argc, char *argv[]) { } int nrows = 0, ncols = 0; - // Read the file line by line while (fgets(line, sizeof(line), f) != NULL) { - // Remove the newline character at the end of the line (if present) line[strcspn(line, "\n")] = 0; nrows++; - // Tokenize the line using whitespace as the separator ncols = 0; token = strtok(line, " \t"); while (token != NULL) {