码迷,mamicode.com
首页 >  
搜索关键字:cout    ( 7219个结果
函数指针
#include typedef int (__stdcall* FUN)(int);//定义函数指针,参数为Int,返回为int,调用约定__stdcallint __stdcall fun1(int x){ std::cout << x << std::endl; return x;...
分类:其他好文   时间:2014-07-10 00:45:12    阅读次数:203
c++转义字符
c++中有非常多转义字符:\b表示的是回退,比方cout<<"hello world"<<'\b'<<endl;在屏幕上显示的仍然是hello world,由于在屏幕上已经输出了,\b并非退格键,它仅仅是相应移动光标往前一个,可是接下的输出就是从光标处開始,比方cout<<"hello w\borl...
分类:编程语言   时间:2014-07-07 17:14:11    阅读次数:209
两个无符号数相减 可以得到负数
#include using namespace std;unsigned int i1=3;unsigned int i2=6;int i3=i1-i2;cout<<i3<<endl; //-3
分类:其他好文   时间:2014-07-03 06:52:51    阅读次数:263
指针杂谈 && memory leak
1、声明一个指针int *pcount; //一个指向int variable的指针,命名为pcountint count = 5;pcount = &count;//&是取地址符, *pcount=&count是错的cout << count; //5cout << pcount; //输出...
分类:其他好文   时间:2014-07-03 00:53:38    阅读次数:317
std::min和自定义宏冲突解决办法
#include#include#define min(a,b)!(b<a)?a:bint main(){ int a=1,b=2; std::cout<<(std::min)(a,b); return 0; }加入一个括号,std::min就不会被宏替代了。
分类:其他好文   时间:2014-07-02 21:20:14    阅读次数:197
分支-05. 用天平找小球(10)
#includeusing namespace std;int main(){ int a,b,c; cin>>a>>b>>c; if(a==b) cout<<"C"<<endl; else if(b==c) cout<<"A"<<endl; else cout<<"B"<<endl; ret...
分类:其他好文   时间:2014-07-02 19:25:08    阅读次数:200
C++语言笔记系列之十五——派生类、基类、子对象的构造和析构函数调用关系
例子 example 1 注:若一个基类同时派生出两个派生类,即两个派生类从同一个基类继承,那么系统将为每一个简历副本,每个派生类独立地使用自己的基类副本(比如基类中有属于自己类的静态变量等)。 #include class Person { public:     person() {cout     ~person() {cout }; class Student:p...
分类:编程语言   时间:2014-07-02 07:50:53    阅读次数:270
[cocos2dx笔记006]流格式日志
在cocos2dx 2.2.2版本中,cocos使用的是CLOG写入日期,其格式是C的Printf方式生成日志。现在也有很多C++流式日志,类似于cout这样的操作。我看了也有很多,log4cxx,等。但是个人移动有些大。我就在我原来的日志中增加了对流式的支持。并顺利移植到cocos2dx环境中使用。下载是在cocos2dx使用的例子。 cocos2dx的日志端类: #ifndef _X_...
分类:其他好文   时间:2014-07-01 11:06:31    阅读次数:253
【设计模式】——外观模式
外观模式(Facade),为子系统中的一组接口提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。 外观模式结构图:代码模板://四个子系统的类class SubSystemOne{public: void MethodOne() { cout MethodOne();...
分类:其他好文   时间:2014-06-30 11:40:31    阅读次数:201
C++ 显示星号密码
#include #include #include using namespace std; int main() { vector password; int len = 0; cout << "Enter password: "; while( true ){ char ch = getch(); if( ch == 1...
分类:编程语言   时间:2014-06-29 23:57:16    阅读次数:406
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!