帮忙看看一个小小的C代码
#include <stdio.h>
#include <malloc.h>
#define DATATYPE2 char
typedef struct node
{
DATATYPE2 data;
struct node *next;
} LINKLIST;
void init(LINKLIST **head) //初始化
{ *head=(LINKLIST *)malloc(sizeof(LINKLIST));
(*head)->next=NULL;
}
LINKLIST *get (int i,LINKLIST *head) //取元素
{int j;
LINKLIST *p;
j=0;
p=head;
while((j <i)&&(p->next!=NULL))
{p=p->next;j++;}
if(j==i) return p;
else return NULL;
}
int leng(LINKLIST *head)//取表长度
{ int j=0;
LINKLIST *p;
p=head;
while(p->next!=NULL)
{ p=p->next;
j++;
}
return j;
}
void insertafter(DATATYPE2 x,LINKLIST *p) //插入元素
{ LINKLIST *t;
t=malloc(sizeof(LINKLIST));
t->data=x;
t->next=p->next;
p->next=t;
}
int insertbefore(DATATYPE2 x,int i,LINKLIST *head) //插入元素
{ LINKLIST *p;
int r=1;
p=get(i-1,head);
if(p!=
相关问答:
//C 接口
extern "C"
{
TESSDLL_API int __cdecl GetTessText(const char *imagefile, char *text);
}
//我在C#中声明
//调用C DLL 中的函数
[DllImport("OCRapi.dll&quo ......
请问用C或C++如何编写求解3D魔方的程序,该从何开始?
谢谢各位,帮忙提点建议吧。
http://www.mofang.net/code/176/182/6581.html
我只能突破60秒!唉。
我刚过40秒
google的android中有个OpenGL ES + ......
问题一:
在对齐为4的情况下
struct BBB
{
long num;
char *name;
short int data;
char ha;
short ba[5];
}*p;
p=0x1000000;
p+0x200=____;
(Ulong)p+0x200=____;
(char*)p+0x200=____;
假设在32位C ......
#include "stdio.h"
int main()
{
char *ch(char *, char *);
char str1[]="I am glad to meet you!";
char str2[]="Welcom to study C!";
&nb ......
请问VFP中如何调用C/C++函数?
你要调用什么功能的函数?要看看VFP中有没有对应的函数,如果有就省着再调用了。如果没有,可以将C/C++函数写个DLL或FLL,然后在VFP调用即可。
十豆三 老师,怎么才能修改自己的 ......