Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Dec 2nd, 2012  |  syntax: None  |  size: 0.93 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /*---------------------------------------------------------*/
  2. /* Search  */
  3. /* */
  4. /* This program searches an array made from a data file for characters   */
  5. /*  */
  6. /*  */
  7.  
  8. #include <iostream>
  9. #include <fstream>
  10. #include <string>
  11. #include <Windows.h>
  12. using namespace std;
  13.  
  14. void main ()
  15. {
  16.         string string;
  17.         double x;      
  18.         int cha[i];
  19.         int count;
  20.         ifstream myfile;
  21.         myfile.open ("char2.txt");
  22.         if (myfile.is_open())
  23.                
  24.         while(!myfile.eof())
  25.                        
  26.         getline(myfile,string);
  27.                                
  28.         if( ! myfile.fail () ) cout << "there's something wrong with the file!\n";
  29.  
  30.         for(count = 0; count < i; count++) if( !(myfile >> cha[i]) ) break;    
  31.                
  32.  
  33.         cout << "Pick a letter betweent 'a' and 'z' to search for \n";
  34.         cin >> "x"
  35.         int flag = 0;
  36.         for (int i = 0, i < 13, i++);  
  37.         if ( x == cha[i])
  38.        
  39.         cout << "Letter found." << endl;
  40.  
  41.         else
  42.  
  43.         cout << "Letter not found." << endl;
  44.  
  45.  
  46.  
  47.  
  48.         myfile.close();
  49.         Sleep (20000);
  50.         return 0;
  51. }