#define _CRT_SECURE_NO_WARNINGS
#include
#include File.h
namespace sdds {
FILE* fptr;
bool openFile(const char filename[]) {
fptr = fopen(filename, r);
return fptr != NULL;
}
int noOfRecords() {
int noOfRecs = 0;
char ch;
while (fscanf(fptr, %c, &ch) == 1) {
noOfRecs += (ch ==
);
}
rewind(fptr);
return noOfRecs;
}
void closeFile() {
if (fptr) fclose(fptr);
}
/* TODO: read functions go here
bool read(.) {
return ..
}
bool read(.) {
return ..
}
bool read(.) {
return ..
}
*/
}
Reviews
There are no reviews yet.