- 博客(8)
- 资源 (1)
- 收藏
- 关注
原创 An out-of-range value
1.If we assign an out-of-range value to an object of unsigned type, the result is the remainder of the modulo the number of values the target type can hold.2.If we assign an out-of-range value to an
2016-07-23 20:17:47 642
原创 Decide which type to use
1.use an unsigned type when you know that the values cannot be negative.2.use int for integer arithmatic. If the data is larger than the minimum guaranteed size of an int, that use long long3.Do n
2016-07-23 19:31:53 235
转载 char & unsigned char & signed char
一、开始今天有一个困扰的问题,就是char与signed char, unsigned char这三者的区别。二、三者之间1.ANSI C 提供了3种字符类型,分别是char、signed char、unsigned char。而不是像short、int一样只有两种(int默认就是unsigned int).2.三者都占1个字节3.signed char
2016-07-23 19:04:06 339
原创 Using file redirection
(Windows OS下) Example.cpp#includeusing namespace std;int main(){int a;cin>>a;cout<<a<<endl;return 0;}注意要在 .exe 文件目录下输入Example.exeoutfile.txt就可以了,>表示数据输出到outfile.txt
2016-07-16 20:44:24 219
原创 How to enter an End-Of-File from the keyboard
Windows: Ctrl+z EnterUNIX\Mac: Ctrl+d Enter
2016-07-15 16:32:19 210
原创 缓冲区
1、What is缓冲区(buffer)?A buffer is a region of a physical memory storage.It's used to store data temporarily.It has tow kinds. One is called input buffer and the others is called output bu
2016-07-12 17:05:57 234
转载 cerr cout clog
cerr(无缓冲标准错误)-----没有缓冲,发送给它的内容立即被输出clog(缓冲标准错误)--------有缓冲,缓冲区满时输出cout-------------------------标准输出三个都是ostream类定义的输出流对象,1.cout是在终端显示器输出,cout流在内存中对应开辟了一个缓冲区,用来存放流中的数据,当向cout流插入一个endl,不论缓冲
2016-07-12 16:07:38 195
原创 文件的大小与内存空间
一个文件的大小就是其实际内容具有的字节数,,以Byte为衡量单位,只要内容不发生变化,就不会改变。一个文件的所占空间是由每个磁盘的簇与文件大小决定的,对于每一个不同的磁盘,它会有不同的簇(分配单元\Allucation\Cluster),而具体计算所占空间的公式为簇数=floor(文件大小/每个分配单元大小)+1所占空间=簇数*每个分配单元大小那么我们该如何知道每一
2016-07-07 23:00:01 1202
Lua程序设计 第3版
2016-07-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人