- 博客(7)
- 资源 (3)
- 收藏
- 关注
转载 6个hello程序
#include #include int n[]={0x48, 0x65,0x6C,0x6C, 0x6F,0x2C,0x20, 0x77,0x6F,0x72, 0x6C,0x64,0x21, 0x0A,0x00},*m=n; main(int n){putchar (*m)!=/0?main (*m++):exit(n++);}#include
2009-10-16 10:46:00
390
原创 new molloc
malloc函数 原型:extern void *malloc(unsigned int num_bytes);用法:#include 功能:分配长度为num_bytes字节的内存块说明:如果分配成功则返回指向被分配内存的指针,否则返回空指针NULL。当内存不再使用时,应使用free()函数将内存块释放。举例:// malloc.c#include #include mai
2009-10-16 10:44:00
526
转载 molloc错误
void GetMemory( char *p ){ p = (char *) malloc( 100 );}void Test( void ) { char *str = NULL; GetMemory( str ); strcpy( str, "hello world" ); printf( “%s”,str );} 这个一个考验对指针理解的题目,上面程序在运行之后: 1,调用Get
2009-10-16 10:43:00
505
转载 string函数源码
memcmp ( ) /* -- C语言库函数源代码 - */ /* Compares count bytes of memory starting at buffer1 and buffer2 and find if equal or which one is first in lexical order. 比较内存区域buffer1和buffer2的前count个字节。当bu
2009-10-16 10:40:00
438
转载 CString类 源码
编写类String的构造函数、析构函数和赋值函数,已知类String的原型为:class String{ public: String(const char *str = NULL); // 普通构造函数 String(const String &other); // 拷贝构造函数 ~ String(void); // 析构函
2009-10-16 10:39:00
718
转载 c编译全过程
C语言编译全过程 编译的概念:编译程序读取源程序(字符流),对之进行词法和语法的分析,将高级语言指令转换为功能等效的汇编代码,再由汇编程序转换为机器语言,并且按照操作系统对可执行文件格式的要求链接生成可执行程序。 编译的完整过程:C源程序-->预编译处理(.c)-->编译、优化程序(.s、.asm)-->汇编程序(.obj、.o、.a、.ko)-->链接程序(.exe、.elf
2009-10-16 10:38:00
284
原创 atoi 源码
atoi的实现int myatoi(const char *src) { int total = 0; while (*src) { total = total*10 + (int)(*src - 0);//什么意思? src++; } return total; }
2009-10-16 10:34:00
331
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人