文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Templates in depth(Chapter 3 of Thinking in C++ Vol 2)

Templates in depth(Chapter 3 of Thinking in C++ Vol 2)

时间:2010-12-25  来源:Ray Z

StringConv.cpp  1 #include "StringConv.h"
 2 #include <iostream>
 3 #include <complex>
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int i = 1234;
 9     cout << "i == \"" << toString(i) << "\"\n";
10 
11     float x = 567.89;
12     cout << "x == \"" << toString(x) << "\"\n";
13 
14     complex<float> c(1.0, 2.0);
15     cout << "c == \"" << toString(c) << "\"\n";
16     cout << endl;
17 
18     i = fromString<int>(string("1234"));
19     cout << "i == " << i << endl;
20     x = fromString<float>(string("567.89"));
21     cout << "x == " << x << endl;
22     c = fromString< complex<float> >(string("(1.0, 2.0"));
23     cout << "c == " << c << endl;
24 
25 }
相关阅读 更多 +
排行榜 更多 +
猎枪行动

猎枪行动

飞行射击 下载
导弹袭击

导弹袭击

飞行射击 下载
猫猫突围封锁要塞新手打法

猫猫突围封锁要塞新手打法

飞行射击 下载