学习C++ -> 向量(vector)
摘要:一、向量的介绍 向量 vector 是一种对象实体, 能够容纳许多其他类型相同的元素, 因此又被称为容器。 与string相同, vector 同属于STL(Standard Template Library, 标准模板库)中的一种自定义的数据类型, 可以广义上认为是数组的增强版。 在使用它时, 需
阅读全文
posted @
2017-12-13 18:39
feng..liu
阅读(5492)
推荐(1) 编辑
float存储
摘要:浮点型变量在计算机内存中占用4字节(Byte),即32-bit。遵循IEEE-754格式标准。 一个浮点数由2部分组成:底数m 和 指数e。 ±mantissa × 2exponent (注意,公式中的mantissa 和 exponent使用二进制表示) 底数部分 使用2进制数来表示此浮点数的实际
阅读全文
posted @
2017-08-31 10:55
feng..liu
阅读(462)
推荐(0) 编辑
C语言浮点数存储方式
摘要:对于浮点类型的数据采用单精度类型(float)和双精度类型(double)来存储,float数据占用 32bit,double数据占用 64bit.其实不论是float类型还是double类型,在计算机内存中的存储方式都是遵从IEEE的规范的,float 遵从的是IEEE R32.24 ,而doub
阅读全文
posted @
2017-08-30 20:53
feng..liu
阅读(16013)
推荐(1) 编辑
获取文件名和扩展名
摘要:#include <string.h>#include <stdio.h>int main(){ char filename[100] = "text.txt"; char *ext = strrchr(filename, '.'); if (ext) { *ext = '\0'; ext++; }
阅读全文
posted @
2017-08-17 14:42
feng..liu
阅读(537)
推荐(1) 编辑
读取一个文件夹所有文件
摘要:#include <windows.h>#include <fstream>#include <iostream>#include <string>#include <iomanip>//不要忘记包含此头文件#include <stdio.h>#include<stdio.h>#include<wi
阅读全文
posted @
2017-08-01 14:31
feng..liu
阅读(771)
推荐(1) 编辑