use include to read a file
#include<iostream>
#include<fstream>
using namespace std; void process(string filename)
{
fstream file(filename);
file << "Hallo world!" << endl;
file.close();
} int main()
{
#include"haha.txt"
string s = "haha.txt";
process(s); return 0;
}
use include to read a file的更多相关文章
- vc编程时说“Cannot open include file: 'unistd.h': No such file or directory”
本文专自http://blog.csdn.net/mangobar/article/details/6314700 unistd.h是unix standard header之意,因此,Linux下开 ...
- 编译错误: file not found with angled include use quotes instead #include <lualib.h> 和 #include "lualib.h"
http://stackoverflow.com/questions/17465902/use-of-external-c-headers-in-objective-c 问题: 7down votef ...
- execve(file, argv, env)参数argv获取字符串个数
/* Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU ...
- [转]require(),include(),require_once()和include_once()区别
require(),include(),require_once()和include_once()区别 面试中最容易提到的一个PHP的问题,我想和大家共勉一下: require()和include() ...
- Apache下开启SSI配置使html支持include包含
写页面的同学通常会遇到这样的烦恼,就是页面上的 html 标签越来越多的时候,寻找指定的部分就会很困难,那么能不能像 javascript 一样写在不同的文件中引入呢?答案是有的,apache 能做到 ...
- FILE文件操作
http://www.jb51.net/article/37688.htm fopen(打开文件)相关函数 open,fclose表头文件 #include<stdio.h>定义函数 FI ...
- Linux File、File Directory IO Operation Summary(undone)
目录 . 引言 . Linux下文件操作API . Linux下文件目录操作API . Linux下的其他设备操作API 1. 引言 Linux支持多种文件系统,如ext.ext2.minix.iso ...
- C使用FILE指针文件操作
文件的基本概念 所谓“文件”是指一组相关数据的有序集合. 这个数据集有一个名称,叫做文件名.实际上在前面的各章中我们已经多次使用了文件,例如源程序文件.目标文件.可执行文件.库文件 (头文件)等.文件 ...
- Layout Resource官方教程(3)在layout中用include嵌入其它layout
简介 <include>Includes a layout file into this layout. 类似 #include ,把layout展开在include处 attribute ...
随机推荐
- java自带的监控工具VisualVM一
转自:http://www.cnblogs.com/wade-xu/p/4369094.html 这篇总结的很不错(本人亲自操手学习),留着以后复习备用,很适合入门级的学习者: VisualVM 是一 ...
- 采用Jenkins搭建持续集成环境
Jenkins介绍 Jenkins是一个CI工具.它可以根据设定持续定期编译,运行相应代码:运行UT或集成测试:将运行结果发送至邮件,或展示成报告... 这样做的最终目的是: 让项目保持健康的状态.如 ...
- CodeForces 706C Hard problem
简单$dp$. $dp[i][0]$:第$i$个串放置完毕,并且第$i$个串不反转,前$i$个串字典序呈非递减的状态下的最小费用. $dp[i][1]$:第$i$个串放置完毕,并且第$i$个串反转,前 ...
- Dom编程(一)
dom:document object model 文档对象模型 1.事件 body 事件:onload onunload onbeforeunload body.document对象的事件 (1)o ...
- Angular React 和 Vue的比较
Angular(1&2),React,Vue对比 一 数据流 数据绑定 Angular 使用双向绑定即:界面的操作能实时反映到数据,数据的变更能实时展现到界面. 实现原理: $scope变量中 ...
- iOS混合应用开发入门
原文出处: cocoacontrols 译文出处:魏志峰(@JeremyWei) 欢迎分享原创到伯乐头条 http://blog.jobbole.com/46554/ 介绍 上周(译者:原文成 ...
- MediaPlayer的错误列表速查(android)
public static final int MEDIA_ERROR_IO Added in API level 17 File or network related operation error ...
- 《JavaScript DOM编程艺术》读书笔记
这是自己JS入门的一本书,反复看过几遍,作者的文笔风趣,阅读起来不枯燥也显轻松~ 本书从JS简史讲到基础语法到DOM,再以一个图片库案例为主线,讲如何运用JS来实现想要的动效,同时对已写案例进行兼容优 ...
- scala实现快速排序
scala> def qSort(a: List[Int]): List[Int] = { | ) a | else qSort( a.filter(a.head > _ )) ++ | ...
- 简单封装常用js方法
1.uploadfiy插件封装 /* 参数:uploadID:上传控件ID url:请求后台url路径 callback:回调函数 */ uploadfiy({ uploadID: $('#btn ...