Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstdlib>
  4. #include <cstring>
  5.  
  6. #include "Criminal.h"
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     char Name[256];
  13.     char Crime[256];
  14.     int Months;
  15.     int Cell = 1;
  16.     Criminal crmPtr;
  17.    
  18.     ifstream ifs;
  19.     ifs.open("crims.txt"); // name of file is hardcoded so no error checking needed
  20.    
  21.     ifs >> Name;
  22.     ifs >> Crime;
  23.  
  24.     cout << Name << endl;
  25.  
  26.     crmPtr = new(nothrow) Criminal(Name, Crime, Months, Cell);
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement