程序中写数据到文件
2016-03-08 08:08
316 查看
#include <iostream>
#include <iomanip>
#include <fstream>
using std;
//ofstream fout2("/home/robot2/Desktop/wheel_right.txt");
string home_value = getenv("HOME");
string file_path = home_value+"/Desktop/wheel_right.txt";
ofstream fout2(file_path.c_str());//或ofstream fout2; fout2.open(file_path.c_str(),ios::app);
fout2<<twist.linear.x<<" "<< twist.angular.z<<std::endl;
#include <iomanip>
#include <fstream>
using std;
//ofstream fout2("/home/robot2/Desktop/wheel_right.txt");
string home_value = getenv("HOME");
string file_path = home_value+"/Desktop/wheel_right.txt";
ofstream fout2(file_path.c_str());//或ofstream fout2; fout2.open(file_path.c_str(),ios::app);
fout2<<twist.linear.x<<" "<< twist.angular.z<<std::endl;
相关文章推荐
- 互联网面试总结(三) : 算法
- 《数据结构》顺序栈
- ATEN宏正盛装出席Infocomm China 2016
- 互联网面试总结(二) : 概述题
- HTML 5 视频使用
- 正则表达式
- 前端性能优化--能用css的地方尽量不要用js
- [leetcode] 167. Two Sum II - Input array is sorted 解题报告
- 软件第二次作业
- 作业
- oracle GROUPING函数
- Linux用户和用户组基本概念
- andriod VideoView
- rcnn学习笔记:Rich feature hierarchies for accurate object detection and semantic segmentation
- HDU 2105 The Center of Gravity (水题)
- huffman树_优先权队列
- js和jquery获取父级元素、子级元素、兄弟元素的方法{转}
- pat1057 stack
- pat1057 stack
- 十进制转化为八进制