摘要: ifstream 的使用方法介绍 一 ersa 2008-12-16 11:29:00 42269 收藏 3 展开 ofstream是从内存到硬盘,ifstream是从硬盘到内存,其实所谓的流缓冲就是内存空间; 在C++中,有一个stream这个类,所有的I/O都以这个“流”类为基础的,包括我们要认 阅读全文
posted @ 2020-05-24 13:21 WAsbry 阅读(615) 评论(0) 推荐(0)
摘要: c++获取文件信息——_stat函数的使用 _stat函数的功能 _stat函数用来获取指定路径的文件或者文件夹的信息。 函数声明 [cpp] view plain copy int _stat( const char *path, struct _stat *buffer ); 参数: path— 阅读全文
posted @ 2020-05-24 13:10 WAsbry 阅读(612) 评论(0) 推荐(0)
摘要: 使用这个结构体和方法时,需要引入:<sys/types.h><sys/stat.h>struct stat这个结构体是用来描述一个linux系统文件系统中的文件属性的结构。可以有两种方法来获取一个文件的属性:1、通过路径:int stat(const char *path, struct stat 阅读全文
posted @ 2020-05-24 13:02 WAsbry 阅读(231) 评论(0) 推荐(0)
摘要: 一. 简介new有三种使用方式:plain new,nothrow new和placement new。 (1)plain new顾名思义就是普通的new,就是我们惯常使用的new。在C++中是这样定义的: void* operator new(std::size_t) throw(std::bad 阅读全文
posted @ 2020-05-24 13:00 WAsbry 阅读(379) 评论(0) 推荐(0)