Last active
October 19, 2018 04:41
-
-
Save joastbg/eed75a6404272156aa7a to your computer and use it in GitHub Desktop.
Read and parse doubles from file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <iterator> | |
| #include <fstream> | |
| #include <algorithm> | |
| int main () { | |
| std::ifstream infile("example.txt"); | |
| std::istream_iterator<double> iit (infile); | |
| std::copy(iit, std::istream_iterator<double>(), | |
| std::ostream_iterator<double>(std::cout, "\n")); | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <iterator> | |
| #include <fstream> | |
| #include <algorithm> | |
| void main() { | |
| std::wifstream infile(L"threadpool.cpp"); | |
| std::istream_iterator<std::wstring, wchar_t> iit(infile); | |
| std::copy(iit, std::istream_iterator<std::wstring, wchar_t>(), | |
| std::ostream_iterator<std::wstring, wchar_t>(std::wcout, L"\n")); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment