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...
Type: Posts; User: Tha_Rappa
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...
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define MAXWORD 15
#define MAXLEN 20
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,...
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.",...
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;
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...
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.
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...
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...
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...
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...
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...
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...