摘要: 假设文件内容为1. hello1 hello2 hello3 hello42. dsfjdosi3. skfskj ksdfls输出每个单词代码#include #include #include #include #include using namespace std;int main(){ string word; ifstream infile("text"); if(!infile) { cout > word) cout >传到word(间隔福为Tab, Space, Enter)输出每一行代码#include #include... 阅读全文
posted @ 2013-12-09 21:31 jihite 阅读(3754) 评论(0) 推荐(1)
摘要: 本质 '\0'就是8位的00000000,因为字符类型中并没有对应的这个字符,所以这么写。'\0'就是 字符串结束标志。 '\0'是转义字符,意思是告诉编译器,这不是字符0,而是空字符。空字符\0对应的二进制为00000000,而数字0为00110000 原来,在C语言中没有专门的字符串变量,通常用 阅读全文
posted @ 2013-12-09 08:39 jihite 阅读(24124) 评论(2) 推荐(2)