guitar-player

read_file_name_using_string.cpp

May 24th, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char* argv[])
  8. {  
  9.     string n;
  10.     n=argv[1];
  11.     int nn=n.find(".");
  12.     string num(n,0,nn);
  13.     int int_n;
  14.     int_n = atoi(num.c_str());
  15.     cout <<"strin :: " << num << "  int:: " << int_n << endl;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment