摘要: #ifndefAFX_XXXXXX_111111000000000_PEOPLE_H#defineAFX_XXXXXX_111111000000000_PEOPLE_H #include<string>usingnamespacestd;//类的实现 classPeople{ public: string m_Name; //姓名 string m_Number; //学号 stringm_Address; //地址 int m_Age; //年龄 //constintlen=20; enum{len=12}; int m_Datas[len]; staticdouble... 阅读全文
posted @ 2013-06-05 19:49 Predator 阅读(350) 评论(0) 推荐(0) 编辑
摘要: void main(){#include <stdlib.h>string score = "98";int res = atoi(score.c_str());cout << res <<endl; int result; cin >> result ;}#include "People.h"#include <sstream>#include <iostream>void main(){int dataInput;cin >> dataInput;stringstre 阅读全文
posted @ 2013-06-05 19:47 Predator 阅读(133) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;template<typename Derived>class SegBase{public://流程框架void segment(){for (int i = 0; i < 2; i++){deal(); //流程内的某个核心部件函数}}void deal_default(){cout << "Use SegBase default" << endl;}void deal(){static_cast<Derived*> (this 阅读全文
posted @ 2013-06-05 19:46 Predator 阅读(233) 评论(0) 推荐(0) 编辑
摘要: #pragma data_seg("MyData")int g_Value; // Note that the global is not initialized.#pragma data_seg()DLL提供两个接口函数:int GetValue(){return g_Value;}void SetValue(int n){g_Value = n;} 阅读全文
posted @ 2013-06-05 19:45 Predator 阅读(163) 评论(0) 推荐(0) 编辑
摘要: char*pStr=newchar[20]; char*pSource="ganquanfu"; strcpy(pStr,pSource); cout<<pStr<<endl;/*string name = "ganquanfu";const char *names = name.c_str();cout<<names<<endl;*/ 阅读全文
posted @ 2013-06-05 19:43 Predator 阅读(567) 评论(0) 推荐(0) 编辑