Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int readFile (ifstream *inFile, struct employee array[]);
- int main () {
- int size = 10;
- struct employee {
- string name;
- int id;
- float salary;
- } array[size];
- ifstream inFile;
- readFile(&inFile, array);
- return 0;
- }
- int readFile (ifstream *inFile, struct employee array[]) {
- inFile->open("pay.txt");
- if(inFile->fail()) {
- cout << "fail";
- exit(1);
- } else {
- cout << "success";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement