关于gcc错误提示
错误提示:a.c:3: error: expected identifier or ‘(’ before ‘{’ token文件
#.c:3: error: expected identifier or ‘(’ before ‘{’ token
include<stdio.h>
void swap (int p1,int p2);
{
int temp=p1;
p1=p2;
p2=temp;
printf("in swap,p1=%d,\np2=%d\n",p1,p2);
}
void swap1 (int*p1 ,int*p2)
{
int temp;
temp =*p1;
*p1=*p2;
*p2=temp;
printf("*in swap1,p1=%d,\np2=%d\n",*p1,*p2);
}
int main()
{
int a=0;
int b=9;
printf("before swap,a=%d,\nb=%d\n",a,b);
-- 插入 -- 2,1 顶端