上一页 1 ··· 4 5 6 7 8
摘要: #include using namespace std; template class MyClass{ public: typename T::SubType * ptr;//vc6里面,此处“typename”可有可无,vs2010里面,此处“typename”必须有 }; class Test{ public: typedef int SubType; }; v... 阅读全文
posted @ 2017-02-23 16:10 sky20080101 阅读(154) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; template class Test{ public: T1 NumNBei(T1 num,T2 N) { return num*N; } }; void main() { Test t; double x= t.NumNBei(2.3,2); cout<<x<<end... 阅读全文
posted @ 2017-02-23 15:34 sky20080101 阅读(429) 评论(0) 推荐(0) 编辑
摘要: #include int main() { #if _PLATFORM_ == _PLATFORM_TRU64 printf("Hello _PLATFORM_TRU64!\n"); #endif #if _PLATFORM_ == _PLATFORM_WIN32 printf("Hello _PLATFORM_WIN32!\n"); #endif return 0... 阅读全文
posted @ 2017-02-23 10:07 sky20080101 阅读(133) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; class Student { public: Student(int age,string name) { m_age=age; m_name=name; } Student(const Student &stu) { ... 阅读全文
posted @ 2017-02-22 23:37 sky20080101 阅读(106) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; void changeFirst(char* c) { c[0]+=1; } int main(int argc, char ** argv_) { int i = 100; int *j = &i; const int *k = const_cast(j); //co... 阅读全文
posted @ 2017-02-16 15:37 sky20080101 阅读(120) 评论(0) 推荐(0) 编辑
摘要: #include #include //front push pop back push pop [] at() #include #include #include //remove using namespace std; void listTest() { int iArray[]={1,2,3,4,5,3,3,3,3,3,6}; list listInt(i... 阅读全文
posted @ 2017-02-15 19:37 sky20080101 阅读(179) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; void Test(); void main() { int a[]={1,2,3,4,5}; vector v_a(a,a+5); vector v_b(v_a.begin(),v_a.end()); vector::iterator it; for (it=v_... 阅读全文
posted @ 2017-02-15 00:57 sky20080101 阅读(254) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; void main() { vector vInt; vInt.push_back(1); vInt.push_back(2); vInt.push_back(3); vInt.push_back(4); vInt.push_back(5); vector::... 阅读全文
posted @ 2017-02-15 00:41 sky20080101 阅读(412) 评论(0) 推荐(0) 编辑
摘要: // TemplateFunction.cpp : Defines the entry point for the console application. // #include "stdafx.h" template T MyMax(T a,T b) { return a>b ? a : b; } int main(int argc, char* argv[]) { i... 阅读全文
posted @ 2017-02-14 23:43 sky20080101 阅读(135) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; void main() { string s="Hello Lucy!"; //s.replace(5,1,"Lily"); //"Lucy" -> "Lily" int indexStart=s.find("Lucy"); string l("Lily"); in... 阅读全文
posted @ 2017-02-14 09:17 sky20080101 阅读(225) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8