- 博客(9)
- 资源 (3)
- 收藏
- 关注
原创 数据库
#ifndef STRUCTURE_H_INCLUDED#define STRUCTURE_H_INCLUDED#define FRAMESIZE 4096#define MAXPAGES 100000#define DEFBUFSIZE 1024#include <string>#include <cstdio>#include "structure.h"using nam
2016-10-29 11:34:28 660
原创 AES算法加密文件
// cryptoDemo.cpp : Defines the entry point for the console application.// Windows: cl cryptoDemo.cpp// Linux: gcc -o cryptoDemo cryptoDemo.cpp -lcrypto#include <memory.h>#include <stdio.h>#include
2016-10-21 21:25:50 890
原创 获取文件长度
// get length of file: infileStream.seekg(0, infileStream.end);//将当前定位到文件末端 long fileLength = infileStream.tellg();//获取当前文件流位置 infileStream.seekg(0, infileStream.beg);//重新指向文件开始
2016-10-21 14:55:30 513
原创 fstream 默认以字符方式读取和写文件,除非设置ios::binary
#include <fstream>#include <cstring>#include <iostream>using namespace std;void test(char name []){ ofstream fout;fout.open("2.jpg",ios::out|ios::binary); ifstream fin; fin.open("1.jpg",
2016-10-21 14:46:39 965
原创 C++ fstream读写文件
#include <fstream>#include <cstring>#include <iostream>using namespace std;void test(char name []){ ofstream fout;fout.open("4.txt",ios::out); ifstream fin; fin.open("3.txt",ios::in);
2016-10-20 22:46:45 473
转载 C++ char a[] char *a
举例: char *s ; s = "China"; 为什么可以把一个字符串赋给一个指针变量。。 这不是类型不一致吗??? 这就是上面提到的关键 。。 C语言中编译器会给字符串常量分配地址,如果 "China", 存储在内存中的 0x3000 0x3001 0x3002 0x3003 0x3004 0x3005 . s = "C
2016-10-20 22:12:26 3006
转载 C++函数模板类模板
#include <iostream>#include <string>using namespace std;template <typename T>inline T const& Max (T const& a, T const& b) { return a < b ? b:a; } int main (){ int i = 39; int j = 20;
2016-10-20 21:02:22 317
转载 C++运算符重载
重载+使得+能够进行复数运算#include <iostream>using namespace std;class Complex{public: Complex( ){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2);//声明重载运算符的函数
2016-10-20 20:41:13 315
原创 latex 画直线
\rule[水平高度]{长度}{粗细}\rule[0.25\baselineskip]{\textwidth}{1pt}\baselineskip是单位 距离下面的距离
2016-10-09 16:21:15 12532
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人