易截截图软件、单文件、免安装、纯绿色、仅160KB

C/C++也可以写的很安全!

今天看到一种比较安全的枚举写法!
enum example
{
item1 = 0,
item2,
item3,
item4,
item5,
max      /* when you want to add element,please add before this */
};
        当你使用它的时候:
example ex1;
        if ( 0 <= ex1 && max <  ex1 ) 
{
do something;
}
这样就可以防止枚举异常越界了!max就是上界!


相关文档:

航空公司管理系统(VC++ 与SQL 2005)

系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
      这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......

linux c mkdir创建递归目录

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define err(msg) perror(msg)
static void mkdirs(const char *dir)
{
        char tmp[1024];
        char *p;
 &nbs ......

linux下c语言关机程序

/* Offtimer.c.For auto halt. */
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
#define DELAY 60/* Time of sleeping */
int main()
{
  time_t now;
  struct tm *p;
  
  while(1)
  {
  now = time(NULL);
&n ......

C/C++编程GUI库比较

最强的GUI库当属Qt,毕竟是商业化的东西,功能最完整,什么都好,包括类似java代码风格,良好的框架设计,但有几点值的一提:
     1.它没有使用STL,而是自己实现了一套替代方案QTL;
     2.事件模型使用自创的signal/slot机制,所以需要moc.exe来预处理头文件;
  &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号