|
함수 프로토 타입의 사용이 틀렸습니다.
void ex();는 main함수 앞에 나와야 하며,
scanf의 사용법도 틀렸습니다.
&를 빼었습니다.
궁금해여~~~~~~ 님이 쓰신 글 :
: 두개값의 입력b와 c를 몇번받을지 a에 넣고 부호를 받은뒤 입력받은 b값들합과c값들합
: 두개를 출력하려는데여...
: call by reference 방식으로 두개의 값을 포인터로 함수를 만들어서 주함수에
: 수행을 할려는데여 자꾸에러가 나여...소스보시고 눈에 띄는 에러체크좀...
:
:
:
: C:\My Documents\새 폴더\Cpp1.cpp(32) : error C2660: 'ex' : function does not take 2 parameters
: C:\My Documents\새 폴더\Cpp1.cpp(34) : warning C4508: 'main' : function should return a value; 'void' return type assumed
: C:\My Documents\새 폴더\Cpp1.cpp(35) : error C2065: 'pb' : undeclared identifier
: C:\My Documents\새 폴더\Cpp1.cpp(35) : error C2065: 'pc' : undeclared identifier
: C:\My Documents\새 폴더\Cpp1.cpp(36) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition
: C:\My Documents\새 폴더\Cpp1.cpp(36) : fatal error C1004: unexpected end of file found
: Error executing cl.exe.
:
: Cpp1.exe - 5 error(s), 1 warning(s)
:
: 이렇게 오류가 떠여 ....
:
:
: #include<stdio.h>
: #define stop '\n'
: main()
: {
: void ex();
: int i,a,b,c;
: scanf("%d",a);
: for(i=1; i<=a; i++)
: {
: scanf("%d %d",b,c);
: }
: ex(b,c);
: printf("%d %d",b,c);
: }
:
:
:
: void ex(pb,pc)
: int *pb,*pc;
: {
: int temp;
: temp = *pb;
: *pb += temp;
: temp = *pc;
: *pc += temp;
: }
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
|