- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 4
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
22 Posted Topics
Re: Code terrible. It is difficult to even understand what you are trying to do. Opening bracket itself:) ... there are no closing parenthesis ... | |
Re: [CODE] #include <string> #include <fstream> #include <iterator> int main() { std::ifstream in1("file1.txt"); std::ifstream in2("file2.txt"); std::ofstream out("file3.txt"); std::istream_iterator<std::string> it1(in1); std::istream_iterator<std::string> it2(in2); std::istream_iterator<std::string> end; while ( it1 != end && it2 != end ) { out << *it1++ << *it2++; } return 0; } [/CODE] | |
Re: I would have solved the problem as follows. Create an array of objects of std:: pair <int, int>. In the loop, when you enter values would determine how to categorize this number. And on the test results would set the flag. ex.: [CODE] typedef std::pair<int, int> item; std::vector<item> array; ... … | |
Re: Proposals are. And the first of them - show the code. | |
Re: libpthread compile as .dll recompile it as static library. | |
Re: [CODE] #include <string> #include <fstream> #include <iostream> #include <algorithm> int main() { const std::string pattern("$$$"); std::ifstream file("d:\\test.txt"); if ( !file ) { std::cerr << "Can`t open file!" << std::endl; return 1; } std::string line; while ( std::getline(file, line) ) { if ( line.empty() ) continue; if ( std::search(line.begin(), line.end(), pattern.begin(), … | |
Re: [CODE] #include <fstream> #include <string> int main() { for ( char ch = 'A'; ch <= 'Z'; ch++ ) { std::string fn = ch + std::string(".txt"); std::ofstream file(fn.c_str()); } return 0; } [/CODE] | |
Re: The only one right decidion is to overload the operator<< () and operator>> () | |
Re: And what is the actual problem? You can do this in two ways. 1. Use regular expressions. 2. Write a simple parser myself. | |
Re: Please format code, and paste in the tags. | |
Re: [CODE] int getPrintDetails() { int gameNum; int point; char print = 0; cout<<"Do you wish to print details <Y/N>?: "; cin >> print; return (print == 'Y'); } [/CODE] | |
Re: [CODE] if ( x > 0 && x <= 380 ) { } [/CODE] like this? | |
| |
Re: Course) No body of Data constructor, only the declaration. | |
Re: All about STL you may find at: [url]http://www.cplusplus.com/reference/[/url] | |
Re: [CODE] int main() { std::cout << "Press 1 for Product 1, 2 for Product 2, 3 for Product 3, 4 for Product 4, 5 for Product 5 or Q to Quit:\n"; int productNumber; int productQTY; std::cin >> productNumber >> productQTY; std::cout << "productNumber = " << productNumber << std::endl; std::cout … | |
Re: [CODE] #include <algorithm> #include <iostream> int main(int argc, const char** argv) { const int N = 15; int storage[N]; // Array to store up to 15 integers. int* end = &storage[N]; // int x; // Variable x, which becomes 0 in the for loop. int number; // This will be … | |
Re: [CODE] #include <vector> #include <iostream> #include <fstream> #include <sstream> #include <iterator> #include <string> #include <cctype> int main() { std::vector<int> arr; std::string str; std::ifstream file("d:\\test.txt"); if ( !file ) { std::cerr << "Can`t open file!" << std::endl; return 1; } while ( std::getline(file, str, ' ') ) { if ( !isdigit(str[0]) … | |
Re: In Windows and Linux I use it: [url]http://get.qt.nokia.com/qtsdk/qt-sdk-win-opensource-2009.04.exe[/url] | |
Re: It is rarely necessary to use such an array. State the problem. |
The End.