
C++ 基本
georgelife7
这个作者很懒,什么都没留下…
展开
-
C++ Reference
C++ 库函数说明大全 http://www.cplusplus.com/reference/转载 2010-07-11 13:15:00 · 315 阅读 · 0 评论 -
C++ 随机变量赋值问题
C语言中随机函数random,C++中随机函数rand。 #include // 标准库(被包含于中)提供两个帮助生成伪随机数的函数: rand()不需要参数,它会返回一个从0到最大随机数的任意整数。 通常rand()产生的随机数在每次运行的时候都是与上一次相同的,这是有意这样设计的,是为了便于程序的调试。 若要产生每次不同的随机数,可以使用srand( seed )函数进行随机化,随着seed的不同,就能够产生不同的随机数。 还可以包含time.h头文件,然后使用srand(time(0)转载 2010-07-17 13:28:00 · 1928 阅读 · 0 评论 -
结构体的内存分配
假设这台机器 sizeof(char) = 1 sizeof(int) = 4 sizeof(double) = 8 枚举类型只为最宽的数据分配内存,在不同是时候,用的是同一块内存; 结构体的内存分配依赖于结构成员的类型; 一: struct s { int i; char c; double d; char* e; char a[]; }; 首先来看对结构体 struct s {转载 2010-07-30 16:24:00 · 338 阅读 · 0 评论 -
C++ 字符(char)与字符串(string)操作
1. 判断一个字符串是否含有非数字字符 2. 把一个字符串(string)内所有字符都转换成大写 3. string 转为 char原创 2010-08-12 18:59:00 · 674 阅读 · 0 评论 -
c++ 控制台I/O
1. 显示字符串,读取字符串 #include using namespace std; void get_filename(string& filename) { cout cout cin >> filename; cout } 引入的头文件: #include using namespace st原创 2010-07-29 16:04:00 · 972 阅读 · 0 评论 -
C & C++,Java study
I think there are 3 main points to learn c++ : pointer c++ library oop of c++ To me the most confused thing is to distinguish which is c feature and which is c++ feature. Please look this as re原创 2012-02-22 00:36:02 · 312 阅读 · 0 评论 -
c++ fstream 格式化输出
#include #include #include #include #include #include #include using namespace std; cout Field(BaseEmployee::EMPI原创 2010-11-12 06:36:00 · 2918 阅读 · 0 评论