C-C++字符输出时遇到字符'\n','\0'区别
2016-03-12 10:12
253 查看
#include "iostream" #include "stdio.h" #include "stdio_ext.h" #include "stdlib.h" #include "string.h" using namespace std; int main(int argc, char const *argv[]) { char buf[] = "www\nqqqq"; char buf1[] = "www\0qqqq"; cout<<"buf="<<buf<<endl; cout<<"-----"<<endl; cout<<"buf1="<<buf1<<endl; return 0; }
输出时遇到字符'\n',输出字符会换行 输出时遇到字符'\0',其后字符不会输出
相关文章推荐
- C-C++字符输出时遇到字符'\n','\0'区别
- c++中 vs 简单的对txt文件读写
- 第三章字符串,向量,数组
- C++设计模式编程中的迭代器模式应用解析
- Wavefront OBJ 转换成OpenGL ES使用的C/C++文件
- C++复习要点总结(一)
- char data[0]在struct末尾的用法
- c++编程规范的纲要和记录
- C语言回顾与再学习——数组与指针
- C++ Exceptional 写异常安全的代码
- 大端模式与小端模式
- C++ exceptional Maximally Reusable Generic Containers
- c++11 对象池的实现
- C++fstream读写文件
- C++string流之istringstream,ostringstream,stringstream类介绍
- c++之浅拷贝和深拷贝
- C语言多维数组总结
- C++上机作业-2
- C++11之右值引用
- 算法竞赛入门经典-学习笔记1(c语言)