View Single Post
Join Date: May 2008
Posts: 99
Reputation: FTProtocol has a little shameless behaviour in the past 
Solved Threads: 1
FTProtocol FTProtocol is offline Offline
Junior Poster in Training

Re: find string in txt file

 
0
  #4
Dec 2nd, 2008
Lol, this isnt for an assignment. I code because i can not because i have to but this is what i have so far.

  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. char szUser[50], szPass[50];
  7. bool bFound = false;
  8.  
  9. int main()
  10. {
  11. ifstream RapidShit ("C:\\Rapid.txt");
  12. string ****Nipples;
  13.  
  14. if(RapidShit.is_open())
  15. {
  16. while (!bFound)
  17. {
  18. getline(RapidShit, ****Nipples);
  19. cout << ****Nipples << endl;
  20.  
  21. if(****Nipples == "WORD")
  22. {
  23. getline(RapidShit, ****Nipples);
  24. cout << ****Nipples << endl;
  25. getline(RapidShit, ****Nipples); // First buffer i need
  26. cout << ****Nipples << endl;
  27. getline(RapidShit, ****Nipples); // Second
  28. cout << ****Nipples << endl;
  29. bFound = true;
  30. }
  31. }
  32. }
  33. cin.get();
  34. return 0;
  35. }

Just wonder how i can store those First buffer line and Second buffer line in char szBuffer1[50], szBuffer2[50];

Thanks
Reply With Quote