码迷,mamicode.com
首页 >  
搜索关键字:cout    ( 7219个结果
函数模板,函数模板重载,可变参数模板,函数模板覆盖,通过引用交换数据
?? 1.函数模板初级,如果想使用模板,需要实例化,实例化的方式是加上数据类型> #include   //函数模板可以对类型进行优化重载,根据类型会覆盖 //如果仍然要使用模板函数,需要实例化   templateclass T> T add(T a, T b) {     std::cout "T add " <<...
分类:其他好文   时间:2014-08-17 01:07:21    阅读次数:292
继承构造函数的执行顺序
转自:http://blog.csdn.net/daheiantian/article/details/6438782Code:#include using namespace std;class A {public:A() {cout<<"int A::A()"<<endl;}A(A &a) {c...
分类:其他好文   时间:2014-08-16 23:37:51    阅读次数:248
《C++primer》v5 第3章 字符串、向量和数组 读书笔记 习题答案
3.1略3.2string str;//读行 while(getline(cin,str)) cout>str) cout>a>>b; if(a==b) coutb) cout>a>>b; if(a.size()==b.siz...
分类:编程语言   时间:2014-08-16 22:20:21    阅读次数:375
C++输出中文字符(转)
C++输出中文字符1. cout场景1: 在源文件中定义 const char* str = "中文" 在 VC++ 编译器上,由于Windows环境用 GBK编码,所以字符串 "中文" 被保存为 GBK内码,编译器也把 str 指向一个包含有 GBK编码的只读内存空间.用 cout 输出 str ...
分类:编程语言   时间:2014-08-16 19:40:10    阅读次数:667
C++继承
C++继承和java中的差不多,下面举个简单示例: main.cpp: #include #include "Box.h" #include "Carton.h" using std::cout; using std::endl; int main(){ Box myBox(40.0,30.0,20.0); Carton myCarton; Carton candy...
分类:编程语言   时间:2014-08-16 13:53:50    阅读次数:266
css3 animation
animation:animation-name | animation-duration | animation-timing-function | animation-delay | animation-iteration-cout | animation-direction | a...
分类:Web程序   时间:2014-08-15 19:12:49    阅读次数:237
C-串知识整理
【C-串比较的错误方式】不能直接比较char buffer1[6]="hello";char buffer2[6]="hello";cout#include//C-串操作的头文件using namespace std;int main(){ char* s1="hello "; char...
分类:其他好文   时间:2014-08-15 12:10:38    阅读次数:136
第二章 数据,变量和计算
头文件#include<>或#include""<>强制类型转换doublea=1.6;cout<<static_cast<int>(a)<<endl;输出为1注意旧的强制类型转换为int(a),这比新的更容易出错,得不到想要的结果,所以推荐static_cast<转换成的类型>()自动判断数据类型auton=16;..
分类:其他好文   时间:2014-08-15 02:54:27    阅读次数:272
为什么通过空指针(NULL)可以正确调用类的部分成员函数
#include using namespace std; class B { public: void foo() { cout << "B foo " << endl; } void pp() { cout << "B pp" << endl; } void FunctionB() { cout << "funB" << endl; } }; int main(...
分类:其他好文   时间:2014-08-14 14:17:38    阅读次数:266
hdu 2039
#includeusing namespace std;int main(){ int n; cin >> n; for (int i = 0; i > a >> b >> c; if (a>0 && a0 && b0 && cc&&a + c > b&&b + c > a) cout <<...
分类:其他好文   时间:2014-08-14 10:26:48    阅读次数:186
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!