摘要: #include "stdafx.h"extern int g_nData; //声明变量extern float g_fData; //声明变量int g_nData; //声明并定义 一个全局变量void fun(int); //声明void fun(float f) //声明并定义{ }void Test1(){ g_nData = 10; fun(10.2f); /************************************************************ * 如果没有 定义变量 报告erro... 阅读全文
posted @ 2011-11-08 16:25 EvilBaby 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include <iomanip.h>int main(int argc, char* argv[]){ //科学计数法 输出 cout.setf(ios::scientific); cout << 1.00006 << endl; //固定格式输出 cout.setf(ios::fixed); cout << 1.00006 << endl; //大写输出(字母) cout.setf(ios::uppercase); cout << hex << 10 << 20 << endl; 阅读全文
posted @ 2011-11-08 16:15 EvilBaby 阅读(148) 评论(0) 推荐(0) 编辑
摘要: //#include <iostream>暂时不用 2个头文件是不同的#include <iostream.h>int main(int argc, char* argv[]){ //C++标准输出对象 // << 运算符(<< >> ++ -- + = & * {} () ... ) 重载(函数) // << 插入符 // >> 提取符 char* lpStr = "lpstr34324"; int nData; cin >> nData ; if ( cin.fail 阅读全文
posted @ 2011-11-08 16:00 EvilBaby 阅读(129) 评论(0) 推荐(0) 编辑