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 ...
随机推荐
- leetcode 024
Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2-&g ...
- js实现复制内容
一.实现点击按钮,复制文本框中的的内容 <script type="text/javascript"> function ...
- 使用canvas实现超绚丽的旋转正方形
自己无意中的一个小"bug",却让动画变得超绚丽= = 所以,不要害怕出bug,谁知道bug不会开出一朵绚丽的花呢? <!DOCTYPE html> <html ...
- css学习之 display:inline-block;
设置display:inline-block;后的元素 就是一个格式化为行内元素的块容器( Block container ):通俗讲就是:将对象呈递为内联对象,但是对象的内容作为块对象呈递.旁边的内 ...
- CodeForces 670D Magic Powder
二分. 二分一下答案,然后验证一下. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cst ...
- 虚拟机在 OpenStack 里没有共享存储条件下的在线迁移[转]
原文链接:http://www.ibm.com/developerworks/cn/cloud/library/1508_wangyx_openstacklivemigrate/ 迁移(Migrati ...
- 兼容不同浏览器的 CSS Hack 写法
所谓 CSS Hack,是指在 CSS 代码中嵌入诸如 *,*html 等代码,方便于独立控制某种浏览器的具体样式.比如有些 CSS Hack 只能被 IE6 或 IE7 识别,而 Firefox ...
- centOS静态ip设置
设置静态IP地址 1,先搜索了一下,得到以下解释IP P地址Netmark 子网掩码Gateway 默认网关HostName 主机名称DomainName 域 ...
- MySQL千万级数据JDBC插入
案例语句: String sql = "LOAD DATA LOCAL INFILE '" + dataFilepath + "' into table " + ...
- SSLv3协议、TLSv1.2协议配置不对导致javax.ws.rs.ProcessingException: java.net.SocketException: Connection reset
SSl:Secure Sockets Layer 安全套接层 TLS:Transport Layer Security传输层安全 是为网络通信提供安全及数据完整性的一种安全协议.TLS与SSL在传输层 ...