Search:

Type: Posts; User: jmack549

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    905

    Calling a function with 2-D array

    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:
  2. Replies
    2
    Views
    4,905

    Scanning filename in?

    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: ");
    ...
  3. Replies
    12
    Views
    1,413

    Okay, so here's my next attempt, but it's still...

    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[]...
  4. Replies
    12
    Views
    1,413

    Okay, after looking at it again, in my main it...

    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...
  5. Replies
    12
    Views
    1,413

    Okay, so I put a printf function at the top of...

    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...
  6. Replies
    12
    Views
    1,413

    Wow, what a beginner's mistake. I haven't done...

    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...
  7. Replies
    12
    Views
    1,413

    Okay, here's what I have so far, and it doesn't...

    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...
  8. Replies
    12
    Views
    1,413

    So to call it, I just put in the name of the...

    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!
  9. Replies
    12
    Views
    1,413

    Arrays as method parameters?

    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...
  10. Replies
    3
    Views
    1,824

    Well my DaysNmonth is already defined, an array...

    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..
  11. Replies
    3
    Views
    1,824

    Trying to find month/day from day of year

    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...
Results 1 to 11 of 11