Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - MemSet
Search - MemSet - List
srand[getpid[]] /* initialize some of the memory */ memset[heightmap, 0, MAPSIZE*MAPSIZE] memset[vpage, 0, RENDERWIDTH * RENDERHEIGHT] printf["Creating dx d fractal terrain\n", MAPSIZE, MAPSIZE] heightmap[0] = [rand[] 128] + 64 // initialize starting point on map CreateFractalMap[0, 0, MAPSIZE, MAPSIZE] printf["Smoothing terrain\n"] for [i = 0 i < 5 i++] SmoothMap[] MakeColorMap[] - srand[getpid[]] /* initialize some of the memory*/ memset[heightmap, 0, MAPSIZE*MAPSIZE] memset[vpage, 0, RENDERWIDTH* RENDERHEIGHT] printf["Creating dx d fractal terrain\n", MAPSIZE, MAPSIZE] heightmap[0] = [rand[] 128]+ 64 // initialize starting point on map CreateFractalMap[0, 0, MAPSIZE, MAPSIZE] printf["Smoothing terrain\n"] for [i = 0 i < 5 i++] SmoothMap[] MakeColorMap[]
Date : 2025-12-31 Size : 4kb User : xrgj

DL : 0
srand[getpid[]] /* initialize some of the memory */ memset[heightmap, 0, MAPSIZE*MAPSIZE] memset[vpage, 0, RENDERWIDTH * RENDERHEIGHT] printf["Creating dx d fractal terrain\n", MAPSIZE, MAPSIZE] heightmap[0] = [rand[] 128] + 64 // initialize starting point on map CreateFractalMap[0, 0, MAPSIZE, MAPSIZE] printf["Smoothing terrain\n"] for [i = 0 i < 5 i++] SmoothMap[] MakeColorMap[] - srand[getpid[]] /* initialize some of the memory*/ memset[heightmap, 0, MAPSIZE*MAPSIZE] memset[vpage, 0, RENDERWIDTH* RENDERHEIGHT] printf["Creating dx d fractal terrain\n", MAPSIZE, MAPSIZE] heightmap[0] = [rand[] 128]+ 64 // initialize starting point on map CreateFractalMap[0, 0, MAPSIZE, MAPSIZE] printf["Smoothing terrain\n"] for [i = 0 i < 5 i++] SmoothMap[] MakeColorMap[]
Date : 2025-12-31 Size : 11kb User : xrgj

linux下如果目录为空目录,则只有.和.这两个也是属于目录类型的本代码使用递归来判断目录及其子目录是否为空目录 /*判断目录是否为空目录*/int IsEmptyDir(char*pszDir){DIR*pstDirp=NULL;struct dirent*pstDirStru=NULL;int ulFileNum=0;int ret=1;char szDir[100];memset(szDir,0,100);pstDirp=opendir(pszDir);if(NULL==pstDirp){printf("open dir error\n");return 0;}while(pstDirStru=readdir(pstDirp)){strcpy(szDir,pszDir);if(DT_DIR==pstDirStru-d_type){if(strcmp(pstDirStru-d_name,".")&&strcmp(pstDirStru-d_name,"."{ret=0;memset(szDir,0,100);sprintf(szDir,"s/s",pszDir,pstDirStru-d_name);IsEmptyDir(szDir);}}else{ret=0;}}closedir(pstDirp);if(ret==1){printf("s is empty dir\n",szDir);}else{printf("is not empty dir\n",szDir);}return ret;}经自己在dedora9下测试通过,希望代码能对大家有点帮助 本文来自: 高校自动化网(Www.zdh1909.com) 详细出处参考(转载请保留本链接):http://www.zdh1909.com/html/linux/12177.html-int IsEmptyDir(char*pszDir){DIR*pstDirp=NULL;struct dirent*pstDirStru=NULL;int ulFileNum=0;int ret=1;char szDir[100];memset(szDir,0,100);pstDirp=opendir(pszDir);if(NULL==pstDirp){printf("open dir error\n");return 0;}while(pstDirStru=readdir(pstDirp)){strcpy(szDir,pszDir);if(DT_DIR==pstDirStru-d_type){if(strcmp(pstDirStru-d_name,".")&&strcmp(pstDirStru-d_name,"."{ret=0;memset(szDir,0,100);sprintf(szDir,"s/s",pszDir,pstDirStru-d_name);IsEmptyDir(szDir);}}else{ret=0;}}closedir(pstDirp);if(ret==1){printf("s is empty dir\n",szDir);}else{printf("is not empty dir\n",szDir);}return ret;}
Date : 2025-12-31 Size : 58kb User : tianwang

DL : 0
包含几个内存管理函数和字符串函数的简单实现,memcpy,memcmp,memset,strsrim等-Simple realization of the memory management functions
Date : 2025-12-31 Size : 2kb User : ytfeng

DL : 0
Slight modifications for pa-risc linux.
Date : 2025-12-31 Size : 1kb User : puihepiu

low level stuff for the following AVM cards:.
Date : 2025-12-31 Size : 2kb User : muijiken

memset: Simple memory set in various ways for Linux v2.13.6.
Date : 2025-12-31 Size : 2kb User : dingherrai

DL : 0
Ceph constants and data types to share between kernel and user space.
Date : 2025-12-31 Size : 8kb User : hanfvsun

DC21285 registers for Linux v2.13.6.
Date : 2025-12-31 Size : 2kb User : henpxker

DL : 0
Slight modifications for pa-risc linux - Paul Bame.
Date : 2025-12-31 Size : 1kb User : gkwuedp

Exception codes returned by the ACPI subsystem.
Date : 2025-12-31 Size : 5kb User : naqxhu

Much of the information about 21264 scheduling coding.
Date : 2025-12-31 Size : 3kb User : pxvmfy

UE Status Low CSR for Linux v2.13.6.
Date : 2025-12-31 Size : 12kb User : gehutao

align the dst to the cache block size if necessary.
Date : 2025-12-31 Size : 1kb User : paliufao

NGbzero.S: Niagara optimized memset clear_user.
Date : 2025-12-31 Size : 1kb User : magaocn

Adjust path mask to use next path and reset retry count. Return resulting path mask.
Date : 2025-12-31 Size : 3kb User : doumlron

ANSI C standard library function memset.
Date : 2025-12-31 Size : 4kb User : lellxd

NG4memset.S: Niagara-4 optimized memset bzero.
Date : 2025-12-31 Size : 6kb User : jzqorv

FIXME: memset.arm.S is using syntax incompatible with XCode.
Date : 2025-12-31 Size : 2kb User : ronmizer

DL : 0
Most apps use memset sanely. Memsetting about 3.4 bytes or less get penalized here compared to the generic implementation Source Code for Linux.
Date : 2025-12-31 Size : 3kb User : puiwivd
« 12 »
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.