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

C常用函数

检查空格字符
#include <ctype.h>
int isspace ( int c );
http://www.cplusplus.com/reference/clibrary/cctype/isspace/
Checks if parameter c is a white-space character.For the purpose of this function, standard white-space characters are:
' '
(0x20)
space (SPC)
'\t'
(0x09)
horizontal tab (TAB)
'\n'
(0x0a)
newline (LF)
'\v'
(0x0b)
vertical tab (VT)
'\f'
(0x0c)
feed (FF)
'\r'
(0x0d)
carriage return (CR)
 /* isspace example */
#include <stdio.h>
#include <ctype.h>
int main ()
{
int c;
int i=0;
char str[]="Example sentence to test isspace\n";
while (str[i])
{
c=str[i];
if (isspace(c)) c='\n';
putchar (c);
i++;
}
return 0;
}

/*
This code prints out the C string character by character, replacing any white-space character by a newline character. Output:

Example
sentence
to
test
isspace
*/


memcpy实现:
char *strcpy(char *strDest, const char *strSrc){
assert((strDest!=NULL) && (strSrc !=NULL)); // 2分
char *address = strDest; // 2分
while( (*strDest++ = * strSrc++) != '\0' ) // 2分
NULL ;
return address ; // 2分
}


相关文档:

Linux下 c 判断一个文件是否存在

#include <stdio.h>
#include <unistd.h>
#define FOO "foo"
int main(void)
{
if(!access(FOO, F_OK))
{
if(!unlink(FOO))
{

}
else
{
printf("remove %s failed\n", FOO);
}
}
else
{
printf("%s not existed\ ......

几种出色的C/C++ GUI函数库的介绍

 
QT
http://www.trolltech.com
http://www.qiliang.net/qt.html
Qt是Trolltech公司的一个多平台的C++图形用户界面应用程序框架。它提供给应用程序开发者建立艺术级的图形用户界面所需的所用功能。Qt是完全面向对象的很容易扩展,并且允许真正地组件编程。自从1996年早些时候,Qt进入商业领域,它已经成为全世界范 ......

ODBC C编程访问数据库

 新建一个Win32 Application,并在相应文件夹下新建一个book.mdb, 里面有一个表BookInfo,表中有以下几例:
id:
BookName:
Author:
等;
//------------------------------------------------------------------------------
// Copyright (c) 2009 eryar All rights reserved.
//
// File : Main.cpp
// ......

C/C++中的文件操作

1.fopen()
  fopen的原型是:FILE *fopen(const char *filename,const char *mode),fopen实现三个功能
为使用而打开一个流 
把一个文件和此流相连接 
给此流返回一个FILE指针
参数filename指向要打开的文件名,mode表示打开状态的字符串,其取值如下表
字符串 含义 
"r" 以只读方式打开文件  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号