/* If you are going to use exit(), include
** stdlib.h. You might as well include it
** anyway so you can use the return status
/* void main is totally wrong, sorry */
/* Allocate memory or use an array, segfaults
** are no fun.
if((infile = fopen("info.txt", "r"))==NULL )
/* perror is much more suited to error reporting
** after standard function calls, you get better
** information. And since you're exiting anyway,
** why not just return and use a more informative
** condition so that readers know the program is
** terminating due to error.
perror("Cannot open input file");
/* fgets is much better for line input, either from
** a file or from stdin.
while(fgets(line, sizeof line, infile) != NULL)
/* Always close your files */
/* main returns an int, keep it portable by using
** either 0, EXIT_SUCCESS, or EXIT_FAILURE