Use files
#include <stdio.h>
#define RECORD_LENGTH 60
main()
{
FILE *fp;
char s[RECORD_LENGTH+1];
if( (fp =
fopen("PORTFOLIO.DAT", "r"))
== NULL)
printf("Cannot open file!\n");
else {
while(
fgets(s, RECORD_LENGTH+1, fp)
!= NULL)
printf("\n%s", s);
fclose(fp);
}
}
Previous slide
Next slide
Back to first slide
View graphic version