#include <iostream> #include <sstream> #include <fstream>> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { ofstream myfile; myfile.open("example.txt"); myfile <<"write test"; myfile.close(); return 0; }
c++ 文件写样例
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
RichEditor组件样例开发
使用richEditor组件实现一个富文本编辑框,包含富文本编辑区域和功能栏,功能栏中有多个按键,可以调整字体大小、字体样式、字体颜色、布局,并可以插入图片。
OpenHarmony 深开鸿 KaihongOS -
c++ map 官方样例
原文地址:https://en.cppreference.com/w/cpp/container/map/map
#include ios 比较器 C -
C++引用和指针简单样例对比
c中没有引用,c++才有引用所以此处用的g++编译
Linux c++ g++ javascript -
C++写文件操作
C++文件操作程序运行时产生的数据都属于临时数据,程序一旦运行结束都会被释放通过文件可
c++ C++文件操作 打开方式 ios 头文件 -
像C++一样写JavaScript
importScripts javascript incude
html css javascript