Hey everyone
I've tried googling this, but I can't seem to find anything close to what I'm doing.
I have to read in a line that the user enters in the terminal... sort of like this:
Enter a Sentence
> This is a sentence entered by the user.
I'd like to use fgets() to accomplish this, but I'm not sure how to pass the console in as a parameter. Every example I can find is fgets(line, LINE_MAX, fp), where line is my char array, LINE_MAX is the max to read in, and fp is a pointer to a file. How can I point to the console?
Thanks for your help with this n00b question!
I've tried googling this, but I can't seem to find anything close to what I'm doing.
I have to read in a line that the user enters in the terminal... sort of like this:
Enter a Sentence
> This is a sentence entered by the user.
I'd like to use fgets() to accomplish this, but I'm not sure how to pass the console in as a parameter. Every example I can find is fgets(line, LINE_MAX, fp), where line is my char array, LINE_MAX is the max to read in, and fp is a pointer to a file. How can I point to the console?
Thanks for your help with this n00b question!