problem z otwieraniem pliku
Ostatnio zmodyfikowano 2012-01-05 20:29
ptaq Temat założony przez niniejszego użytkownika |
problem z otwieraniem pliku » 2012-01-05 20:19:11 witam, coś sknocilem ale nie moge się dopatrzeć co, dlaczego nie otwiera mi pliku???
#include<iostream> #include <string> #include<fstream>
void CheckTime()
{ std::string times; std::cout << "\n "; std::cin >> times; std::string line; int czyZnaleziono; std::ifstream fileInput( "*.txt" ); if( fileInput.is_open() ) { do { while( std::getline( fileInput, line ) ) { czyZnaleziono = line.find( times ); if( czyZnaleziono != std::string::npos ) { std::cout << "\n"; std::cout << "\n"; std::cin >> times; std::cout << std::endl; } } } while( czyZnaleziono != std::string::npos ); std::cout << std::endl; std::cout << "\n"; std::cin.clear(); std::cin.sync(); } else std::cout << "plik nie został otwarty"; }
int main() { std::string times; int a; CheckTime(); std::cin >> a; }
|
|
ptaq Temat założony przez niniejszego użytkownika |
» 2012-01-05 20:29:34 już wiem :D bo go tam nie ma <zawstydzony> wybaczcie |
|
« 1 » |