- 博客(12)
- 资源 (20)
- 收藏
- 关注
原创 c++中的placement new
#include using namespace std;struct base { int i; virtual void f(){ cout << "in base calss" << endl; }};struct derived : base { int j; void f() { cout << "in
2013-04-08 22:06:55 947
原创 单词加密
#include #include #include #include #define MAX_LEN 1000000static int f(int i);static int index(int c);void encrypt(char *str);char str_buffer[MAX_LEN];int main(int argc, char *argv[]){
2013-04-08 22:02:31 1594
原创 C++中的拷贝构造函数和赋值操作符
#include using namespace std;class base { private: int a; public: base(int x=0):a(x) { cout<< "base construct function:" << a << endl; } base(const base &b){
2013-04-08 21:48:57 895
原创 c++中的const
#include #include using namespace std;const int size = 100;int main(){ // size = 10; //error: assignment of read-only variable 'size' // int *ptr_size = &size; //error: invalid conversion
2013-04-08 21:40:13 963
原创 一个典型的内存泄露程序
好像能将Linux卡死,windows却毫无压力。#include #include #define UNIT 1024*1024 int main(int argc, char * argv[] ) { int i; int j; int k; int * ptr;while(1) { for(i=0; i<1024; i
2013-04-08 21:35:34 1011
原创 C++中<< 运算符的计算顺序
#include using namespace std;template void swap(T &a, T &b) { T temp(a); a = b; b = temp;}template T add(const T &a, const T &b) { return a + b;}int main(){ cout << "
2013-04-08 21:25:36 1332
原创 C++中的置换实现全排列,参照标准模板库中置换
#include #include #include #include using namespace std;void swap(int *a, int *b);void reverse(int *begin, int *end);void printRange(int *begin, int *end);bool int_next_permutation(int *
2013-04-08 20:59:58 1082
原创 c++中class与struct的区别
C++中:1.class中成员的默认访问权限是private,struct中的成员的默认访问权限是public。2. class的默认继承方式是private, struct 的默认继承方式是public。#include using namespace std;struct A { int a;};struct B : A { //等价于 struct B :
2013-04-08 20:24:20 953
原创 求某一天是星期几以及记时
c语言中的time相关函数:#include #include #include using namespace std;void printlocaltime();int main(){ time_t rawtime; struct tm *timeinfo; int year, month, day; char *weekday[] = { "Sunda
2013-04-08 20:14:43 1151
原创 cpp中typeid
cpp中typeid举例:#include #include //for 'typeid'using namespace std;class Person {public: // ... Person members ... virtual ~Person() {}};class Employee : public Person { // ... Em
2013-04-08 20:02:35 1304
原创 C++中的sizeof
C++中sizeof返回对象的所占空间的字节数。#include #include using namespace std;int main(int argc, char *argv[]){ string strArr1[] = {"Trend", "Micro", "soft"}; string *p = new string[2]; p[0]= "US"
2013-04-08 19:53:57 943
原创 统计文章中词的词频
统计文章中的单词的词频,可以使用C++中Map来实现。1.统计从标准输入输入的单词的词频。#include #include #include using namespace std;int main(int argc, char *argv[]) { string s; map counter; while(cin >> s) { if(s[0] =
2013-04-08 19:31:14 1684
Verilog HDL IEEE Std 1364-2001
2012-11-22
The Mathematics of the RSA Public-Key Cryptosystem
2012-01-05
RSA_theory :RSA的数学原理
2012-01-05
stm32f10x_fw_archive.zip
2012-01-02
STM32F10X在Keil MDK环境下在RAM中调试的设置方法.pdf
2012-01-02
stm32f10x标准固件库的帮助文档(stm32f10x_stdperiph_lib_um.chm)
2012-01-02
MySQL中文参考手册-chm格式┊Mysql官方权威教程.rar
2008-12-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人