Advertisement
Guest User

Untitled

a guest
Apr 14th, 2010
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. //Check for user name, this all executes perfectly fine.
  2.     ofstream oFile;
  3.     ifstream iFile;
  4.    
  5.    
  6.     iFile.open("/APPData.dat");
  7.      if (iFile.is_open())
  8.      {
  9.        while (!iFile.eof())
  10.        {
  11.          getline(iFile,holdUsername);  
  12.        } //When the WHILE ENDS it jumps straight to "enter selection" down there.
  13.      }else{          
  14.          oFile.open("/APPData.dat");
  15.          oFile.close();
  16.          
  17.          iFile.open("/APPData.dat");
  18.              if (iFile.is_open())
  19.                {
  20.                  while (!iFile.eof())
  21.                    {
  22.                      getline(iFile,holdUsername);  
  23.                    }
  24.              
  25.                }
  26.            }
  27.    
  28.     //This wont execute!, It skips to "enter selection"
  29.     if (sizeof(holdUsername) < 2)
  30.     {
  31.         cout << holdUsername;
  32.         cout << sizeof(holdUsername);
  33.         cout << "test";
  34.        
  35.     }
  36.    
  37.     //Enter Selection
  38.     cout << "\n\n Please choose format: 1 = Generic  2 = Specific  3 = Default \n\n Enter Selection now: ";
  39.     cin >> cselection;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement