Given this:
Code:
#define MAXLINE 100
and
Code:
int main(void)
{
int line[MAXLINE];
.....................
Would this be correct?
I'm not really familiar with strtol(). I looked it up, and gave this a try.
Code:
void get_info(char *filename, int *line)
{
prinf("\n%S\n\n%s",
"This progam creates a file of random numbers.",
"Please enter in the number of random numbers
you would like to see as a positive integer. "),
fget( line, MAXLINE, stdin);
if( strtol( line ) != 1)
{
printf("\nERROR: Please enter positive integer.\n");
}
printf("\nIn what file would you like them? ");
scanf("%s", filename);
}