So I'm trying to call a function with a 2-D array. First of all, I have this:
#define DATELEN 9
#define NAMELEN 20
#define NCOL 3
Then, I define the function:
Type: Posts; User: jmack549
So I'm trying to call a function with a 2-D array. First of all, I have this:
#define DATELEN 9
#define NAMELEN 20
#define NCOL 3
Then, I define the function:
So usually we do:
#define FILENAME input.txt
But this project we have to prompt for the filename. I've tried doing:
printf("Enter the name of the data file w/ extension: ");
...
Okay, so here's my next attempt, but it's still not working.
int MAX_GAMES = 100;
int month[MAX_GAMES], day[MAX_GAMES], auburn[MAX_GAMES], opp[MAX_GAMES], attend[MAX_GAMES];
readStats (month[]...
Okay, after looking at it again, in my main it looks like I'm re-declaring readStats. I feel like I shouldn't have int in front of it, but when I remove it, it gives me a syntax error. Am I calling...
Okay, so I put a printf function at the top of readStats, and it didn't run it...so apparently, I'm not calling it correctly.
This is so frustrating, I've done all of my projects with ease, this...
Wow, what a beginner's mistake. I haven't done that in months. Anyways, is there any other reason you see it wouldn't be printing out anything? It could be my input file I guess...
Okay, here's what I have so far, and it doesn't seem to be working. Is there a better debug method besides temp print lines? Thanks again!
#include <stdio.h>
#include <math.h>
#include...
So to call it, I just put in the name of the array, with the size I want the array to be? Sorry, most array things have come naturally to me, but this just seems confusing. Thanks for the help!
We have this project, where one of the methods is called readStats. Basically, it reads numbers from a file. The method is:
int readStats( int month[], int day[], int auburn[], int opp[], int...
Well my DaysNmonth is already defined, an array of 13 objects, because daysNmonth[0] is set to 0, and we ignore it. So daysNmonth[1] - daysNmonth[12] = the days of the month, such as 31, 28, etc..
So in one of our assignments we have to have someone input the day of the year (ex. 59) and have it output the month and day (ex. 2/28). All we have to work with is an array that declares how many...