summaryrefslogtreecommitdiffstats
path: root/friendfinder/read_file.c
blob: 8903a0926d6cdc5461a69e2a9b5359cff8f6d715 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "stdio.h"


char* read_key()
{
	FILE *fr;            /* declare the file pointer */
	

   	int n;
   	long elapsed_seconds;
   	char line[200];
   	//clrscr();

   	fr = fopen ("elapsed.dta", "rt");  /* open the file for reading */
   	/* elapsed.dta is the name of the file */
   	/* "rt" means open the file for reading text */

   	while(fgets(line, 200, fr) != NULL)
   	{
	 	/* get a line, up to 80 chars from fr.  done if NULL */
	 	sscanf(line, "%ld", &elapsed_seconds);
	 	/* convert the string to a long int */
//	 	printf ("%ld\n", elapsed_seconds);
   	}
   	fclose(fr);  /* close the file prior to exiting the routine */

	return line;
}