#include<stdio.h>void main(){ int a,b;a=5,b=10;printf("before swap a=%d,b=%d\n",a,b);swap(&a,&b);printf("after swap a=%d,b=%d\n",a,b);}swap( px, py){int * px,* py;int temp;temp = * px;* px = * py;* py = temp;printf("in swap x=%d,y=%d\n",* px ,* py);}運(yùn)行結(jié)果時(shí)候zhizhengmain.cppF:\C語言\20130702\zhizhengmain.cpp(7) : error C2065: 'swap' : undeclared identifierF:\C語言\20130702\zhizhengmain.cpp(10) : error C2065: 'px' : undeclared identifierF:\C語言\20130702\zhizhengmain.cpp(10) : error C2065: 'py' : undeclared identifierF:\C語言\20130702\zhizhengmain.cpp(11) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition執(zhí)行 cl.exe 時(shí)出錯(cuò).zhizhengmain.obj - 1 error(s), 0 warning(s)為什么??
C語言指針函數(shù)錯(cuò)誤?
三國(guó)紛爭(zhēng)
2019-02-07 11:07:51