随笔分类 -  我的C++之路

摘要:#include "stdio.h"#define N 5main(){ int n,i,j,m=1; int a[N][N]={0};//定义螺旋数组,并初始化 //螺旋数组的实现 for(n=0;n=n; j--) a[N-n-1][j] = m++; for(i=N-n-2; i>n; ... 阅读全文
posted @ 2014-04-02 10:10 action爱生活 阅读(194) 评论(0) 推荐(0)
摘要:1.输入一个字符串,将其逆序后输出。(使用C++,不建议用伪码)#include using namespace std;void main(){ char a[50];memset(a,0,sizeof(a)); int i=0,j; char t; cin.getline... 阅读全文
posted @ 2014-03-31 17:55 action爱生活 阅读(223) 评论(0) 推荐(0)
摘要:Singleton.cpp/******************************************************************************Module: Singleton.cppNotices: Copyright (c) 2008 Jeffrey R... 阅读全文
posted @ 2014-03-25 10:13 action爱生活 阅读(337) 评论(0) 推荐(0)
摘要:/* * Helper function to read the content of a file into a buffer * avoids incompatible systemcalls */static void *read_file(FILE *fp, size_t *o_filele... 阅读全文
posted @ 2014-03-10 18:30 action爱生活 阅读(156) 评论(0) 推荐(0)
摘要:C语言的静态函数当一个源程序由多个源文件组成时,根据函数能否被其它源文件中的函数调用,将函数分为内部函数和外部函数。1内部函数(又称静态函数)如果在一个源文件中定义的函数,只能被本文件中的函数调用,而不能被同一程序其它文件中的函数调用,这种函数称为内部函数。定义一个内部函数,只需在函数类型前再加一个... 阅读全文
posted @ 2014-03-10 18:26 action爱生活 阅读(172) 评论(0) 推荐(0)
摘要:mciSendString用法使用MCI API,源文件中需要包含头文件 Mmsystem.h,在Project->Settings->Link->Object/libray module中加入库 Winmm.lib。 VS2008在源文件加上#include "mm... 阅读全文
posted @ 2014-02-20 10:59 action爱生活 阅读(467) 评论(0) 推荐(0)