函数(定义、声明、调用)函数定义:返回值类型函数名(参数表(形参:没有内存的):类型+参数名){函数体;}函数分类:从实现的角度:库函数与自定义函数(实现)从参数表的角度:有参函数与无参函数(参数表)从返回值角度:有返回值(函数体中必须有return)与无返回值(void)(返回值)函..
分类:
其他好文 时间:
2015-11-19 07:25:09
阅读次数:
156
这里memcpy与memmove函数的模拟实现,需要用到空指针来传递参数,之后强制类型转换为char型,用size_t这个宏接受偏移量进行偏移,模拟实现如下:memcpy函数:void*my_memcpy(void*dst,constvoid*src,size_tcount)
{
assert(dst);
assert(src);
void*ret=dst;
while(count--)
{
..
分类:
编程语言 时间:
2015-11-19 07:16:11
阅读次数:
160
#define_CRT_SECURE_NO_WARNINGS1
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
void*my_memmove(void*p1,void*p2,size_tcount)
{
assert(p1);
assert(p2);
char*dest=(char*)p1;
char*src=(char*)p2;
dest=dest+16;
src=src+8;
if((src<de..
分类:
编程语言 时间:
2015-11-19 07:15:14
阅读次数:
201
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
void*my_memcpy(void*p1,constvoid*p2,size_tcount)
{
assert(p1);
assert(p2);
char*dest=(char*)p1;
char*src=(char*)p2;
while(count--)
{
*dest++=*src++;
}
returnp1;
}
intmain()
{
floatar..
分类:
数据库 时间:
2015-11-19 07:15:07
阅读次数:
118
#define_CRT_SECURE_NO_WARNINGS1
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
void*my_memcpy(void*p1,constvoid*p2,size_tcount)
{
assert(p1);
assert(p2);
char*dest=(char*)p1;
char*src=(char*)p2;
char*ret=dest;
while(count--)
{
*d..
分类:
编程语言 时间:
2015-11-19 07:14:53
阅读次数:
135
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
void*my_memmove(void*p1,constvoid*p2,size_tcount)
{
assert(p1);
assert(p2);
char*dest=(char*)p1;
char*src=(char*)p2;
dest=dest+16;
src=src+8;
if((src<=dest)&&(dest<=(sr..
分类:
数据库 时间:
2015-11-19 07:14:42
阅读次数:
207
#define_CRT_SECURE_NO_WARNINGS1
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
void*my_memmove(void*p1,void*p2,size_tcount)
{
assert(p1);
assert(p2);
char*dest=(char*)p1;
char*src=(char*)p2;
dest=dest+16;
src=src+8;
if((src<de..
分类:
编程语言 时间:
2015-11-19 07:14:32
阅读次数:
192
private void AutofacIoCRegister() { HttpConfiguration config = GlobalConfiguration.Configuration; if (_containerPr...
1 #include 2 3 static void RenderSceneCB() 4 { 5 glClear(GL_COLOR_BUFFER_BIT); 6 glutSwapBuffers(); 7 } 8 9 static void InitializeGlutCall...
分类:
其他好文 时间:
2015-11-19 01:57:39
阅读次数:
168
内容来自TsinghuaX: 30240184X 数据结构(2015秋)这门课的Vector一章,对bubblesort有两次常数优化。函数原型是这样的: void bubble(Rank lo, Rank hi); void bubbleSort(Rank lo, Rank hi);Rank即.....
分类:
其他好文 时间:
2015-11-19 00:43:32
阅读次数:
337