Search:

Type: Posts; User: Tha_Rappa

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    4,558

    Scanning Data into a structure from a File

    Can anybody help me understand why this isn't working correctly, I'm attempting to scan in the data from a command line file. I am storing the data in structures but every time I compile and run, the...
  2. Replies
    18
    Views
    2,474

    #include #include #include...

    #include <stdio.h>
    #include <ctype.h>
    #include <string.h>


    #define MAXWORD 15
    #define MAXLEN 20
  3. Replies
    18
    Views
    2,474

    what am I doing wrong here? Can somebody help me...

    what am I doing wrong here? Can somebody help me figure it out? I'm grateful for everything I've been shown thus far, I wish I would have known about this site sooner.


    void openFile(char *pFPIn,...
  4. Replies
    18
    Views
    2,474

    So should I check argc in main? Like: if...

    So should I check argc in main?

    Like:


    if (argc != 3)
    printf("Not enough command line arguments");
    else if (argv[1] < 1 || argv[1] >15)
    printf("Number %d is not between 1 and 15.",...
  5. This should get you started. #define COLS...

    This should get you started.



    #define COLS 5 //for the amount of titles you have
    #define ROW ?? //need to put how many of each rows you have

    int main(void)
    {
    FILE *fpIn;
  6. Replies
    18
    Views
    2,474

    So argv[1] would be equal to the number that was...

    So argv[1] would be equal to the number that was on the command line? So in the example of

    ./a.out 9 file

    argv[1] would equal 9
    and
    argv[2] would be the filename?

    I'm guessing fully...
  7. I'd probably scan all the files into an array and...

    I'd probably scan all the files into an array and then when the specific column is called you can print out the data in that column.
  8. Replies
    18
    Views
    2,474

    Well I'm confused because of the examples I was...

    Well I'm confused because of the examples I was shown.
    In the examples argc was the amount of words read out of a specific file.
    Argc (in this case) is to between 1 and 15. And argv[] is supposed...
  9. Replies
    18
    Views
    2,474

    Yea, I havent gotten that far yet. I'm still...

    Yea, I havent gotten that far yet. I'm still working on the functions and the passing.
    Anybody have any advice for how to fix the openFile function?
    It needs to tell if main has enough arguements...
  10. Replies
    18
    Views
    2,474

    Thanks everybody, but my issue is that the user...

    Thanks everybody, but my issue is that the user puts the amount of strings to find in the file on the command line.

    So an example of the command line would look like:
    $ ./a.out 9 file

    So far I...
  11. Replies
    18
    Views
    2,474

    How do I check the 1 through 15 conditions and...

    How do I check the 1 through 15 conditions and the amount of data in the file? Can I do that through the openFile function, or is that done through main?


    Example:
    my command line is $./a.out 6...
  12. Replies
    18
    Views
    2,474

    Wow, thanks for the quick response. sorry I...

    Wow, thanks for the quick response.
    sorry I bumped the old thread, but I figured old better than new, guess not. Thanks for the pointer though.

    So now I can check the data arguements in the...
  13. Replies
    18
    Views
    2,474

    Command Line Arguements

    I'm attempting to write some code that uses command line arguements to read x amount of character strings (words) from a file.

    I am unaware of how to open the file from the command line or...
Results 1 to 13 of 13