码迷,mamicode.com
首页 >  
搜索关键字:cout    ( 7219个结果
e^x值
#include<iostream> #include<cmath> usingnamespacestd; doublefac(intn) { if(0==n) return1; elseif(1==n) return1; else returnn*fac(n-1); } intmain() { doublex,sum; charans; do { cout<<"Pleaseinputthex:\n"; cin>>x; cout<<"The..
分类:其他好文   时间:2014-08-25 17:14:45    阅读次数:190
C++中初始化和定义对象的语法,带括号与不带括号的区别
小记:运行环境:win xp vs2008#include #include using std::cout;using std::cin;using std::endl;using std::istream;using std::ostream;class y{private: int a;pub...
分类:编程语言   时间:2014-08-25 11:23:24    阅读次数:253
关于函数指针
#include #include #include using namespace std;struct cwd{ int a; void (*add)(int , int );};void pluss(int a , int b){ int c=a+b; cout<<c...
分类:其他好文   时间:2014-08-24 18:01:32    阅读次数:195
C++11学习笔记之三lamda表达式,std::function, std::bind
//lamda //first lamda [] {}; // second lamda []() //or no need () when paramater is null { std::cout bool { return (bool)i; }(5); //5, lamda captu...
分类:编程语言   时间:2014-08-23 21:39:11    阅读次数:195
复制构造和赋值构造的一些尝试
小记:运行环境:vs 2013c++win32 consoleapplication#include "stdafx.h"#include #include using namespace std;class A{public: A(){ cout << "A::A()" << endl; } .....
分类:其他好文   时间:2014-08-23 15:17:00    阅读次数:216
C++ cout的转换格式输出(八进制和十六进制)
COUT可以转换格式输出...
分类:编程语言   时间:2014-08-22 10:54:36    阅读次数:219
decltype typename
decltype((variable))总是引用类型,但是decltype(variable)只有当variable是引用类型时才是引用类型。#include #include using std::cin;using std::cout;using std::endl;auto f(auto x)...
分类:其他好文   时间:2014-08-21 20:59:44    阅读次数:209
【STL】帮你复习STL泛型算法 一
STL泛型算法#include #include #include #include #include #include using std::cout;using std::endl;using std::vector;using std::list;bool IsOushu(const in.....
分类:其他好文   时间:2014-08-21 01:29:03    阅读次数:218
C++学习笔记36 模版的显式具体化和显式实例化
C++的模版有时候很可能无法处理某些类型。 例如: #include using namespace std; class man{ private: string name; int data; public: man(string s,int i):name(s),data(i){ } void show()const{ cout<<"this name is "<<nam...
分类:编程语言   时间:2014-08-21 00:16:43    阅读次数:261
ns3 常用优化技术
ns3中大部分程序使用C++,对C++的很多部分都进行了优化,比如日志系统/智能指针等. 于是就想起写这片文章来总结一下. 1. Logging系统 C++中一般使用std::cout来打印消息,当打印语句增多时,这个就不太实用了,于是出现了Logging系统,其实是对打印的消息进行了分类,从而更好的控制打印的消息.log的级别在程序中是这样设定的: enum LogLevel { LO...
分类:其他好文   时间:2014-08-19 19:13:25    阅读次数:371
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!