『*****C程序找错*****』
这是一个头文件,代码如下:程序代码:
#include<stdlib.h> #include<string.h> #include<ctype.h> #include<stdio.h> //用typedef自定义类型 typedef struct address{ char name[6]; char tel[18]; struct address *next; }ADDR; //宏定义函数ASk(),调用一次产生一新结点 #define ASK(p) do{ \ p=(ADDR *)malloc(sizeof(ADDR)); \ if(p==NULL) { printf("memory faill!");exit(); } \ }while(0) extern int count; ADDR *input(ADDR *); void display(ADDR *); int menu_select(void); void handle_menu(ADDR *); ADDR *del(ADDR *);
结果如下:
程序代码:
d:\编程\msdev98\myprojects\vitas_2010_10_12_1\vitas2010_10_12_the1\record.h(20) : error C2501: 'p' : missing storage-class or type specifiers d:\编程\msdev98\myprojects\vitas_2010_10_12_1\vitas2010_10_12_the1\record.h(20) : error C2440: 'initializing' : cannot convert from 'struct address *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast d:\编程\msdev98\myprojects\vitas_2010_10_12_1\vitas2010_10_12_the1\record.h(21) : error C2143: syntax error : missing ';' before 'if' d:\编程\msdev98\myprojects\vitas_2010_10_12_1\vitas2010_10_12_the1\record.h(21) : error C2143: syntax error : missing ';' before '{' d:\编程\msdev98\myprojects\vitas_2010_10_12_1\vitas2010_10_12_the1\record.h(21) : error C2447: missing function header (old-style formal list?) d:\编程\msdev98\myprojects\vitas_2010_10_12_1\vitas2010_10_12_the1\record.h(22) : error C2143: syntax error : missing ';' before '}' d:\编程\msdev98\myprojects\vitas_2010_10_12_1\vitas2010_10_12_the1\record.h(22) : error C2143: syntax error : missing ';' before '}' d:\编程\msdev98\myprojects\vitas_2010_10_12_1\vitas2010_10_12_the1\record.h(22) : error C2143: syntax error : missing ';' before '}'
这个是我从书上打下来的,有小小改动,想了很久也不知所以,求救。。。