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

C/C++ 路径为目录判断

#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
/****************************************************
* 函数功能: 判断参数路径是否为(正确的)目录
* 函数返回: 0为表示路径为文件,1为非目录.其他为错误
*    参数: path文件需要判断的目录的路径.
*          可以为相对路径.
*
*****************************************************/
int isDir(const char *path)
{
        struct stat info;
        if ( 0 != stat(path,&info) )
        {
                return -2;
        }
        if( info.st_mode & S_IFDIR )
        {
                return 0;
        }
        else
        {
                return 1;
        }
}


相关文档:

C和指针 的读书笔记(自己整理)

第2章
环境:翻译环境: 源代码转化成可执行的机器指令。
执行环境:用于实际执行代码。
翻译:源文件-〉目标文件-〉可执行文件(通过链接器将多个目标文件捆绑在一起)
编译过程:预处理器-〉源代码经过解析产生目标代码(这个过程中是绝大多数错误和警告产生的地方)-〉优化器(就是对目标代码进行进一步优化,使效率 ......

数学排列组合算法 P(N,M) C(N,M)

yeah,组合的也出来了,再一起发一个
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication32
{
class Program
{

static int s = 0;
static void Main(string[] args)
{
Console.Writ ......

C/C++笔试、面试题目汇总

1.求下面函数的返回值(微软)
int func(x)
{
int countx = 0;
while(x)
{
countx ++;
x = x&(x-1);
}
return countx;
}
假定x = 9999。 答案:8
思路:将x转化为2进制,看含有的1的个数。
2. 什么是“引用”?申明和使用“引用”要注意哪些问题?
答:引用就是某个目标变量的&ldquo ......

C/C++ DIR遍历函数

#include <list.h>
#include <dirent.h>
#include <iostream.h>
#include <sys/stat.h>
#include <sys/types.h>
/*****************************************************************
*函数功能: 目_录_遍_历.
*返回值:   成功返回0,失败返回非0.
*参数   path ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号