to get you started, you're going to be using a 2-dimensional array which will look like this by calling array[3][4]:
then you'll use for loops to put numbers into each array element and then you can do the calculations...
User Profile
Collapse
-
Read an input file into a single string
The input file data size is unknown so I would have to use malloc( ) to allocate enough memory for the file data. In order to do this, I would need to read each character of the file possibly by using a counter and then returning the counter as "totalChar" and allocating memory for it. The code I have so far is:
...Code:#define FILENAME_SIZE 15 #define FILESIZE_MAX 10000 char filename[FILENAME_SIZE];
-
Open, Read, Print an input file
I'm a beginner for C programming. For a part of my project, I have to take an input file from the user and be able to print it onto the screen. This is what I have so far:
...Code:char filename[10]; FILE *ifp; printf("Enter the name of the file to analyze :"); scanf("%s", filename); printf("\n"); ifp = fopen(filename, "r"); if (ifp ==
No activity results to display
Show More
Leave a comment: