ulvis.paste.net

Paste Search Dynamic
Recent pastes
double num
  1. #include <vector>
  2. #include <string>
  3. #include <sstream>
  4. #include <iostream>
  5. #include <iterator>
  6.  
  7. int main(int argc, char** argv) {
  8.     std::vector<double> v;
  9.     std::stringstream ss;
  10.     for(int i = 1; i < argc;i++) {
  11.         double num;
  12.         double* p = &num;
  13.         ss << argv[i];
  14.         ss >> *p;
  15.         std::cout << *p << std::endl;
  16.         v.push_back(argv[i]);
  17.     }
  18.  
  19.     std::vector<double>::iterator i = v.begin();
  20.     for(i; i != v.end();i++) {
  21.         std::cout << *i << std::endl;
  22.     }
  23.     return 0;
  24. }
Parsed in 0.005 seconds