-2
그래서 내가 비주얼 스튜디오에서이 작업을 실행하기 위해 노력하고있어하지만 나에게 출력 콘솔에서 몇 가지 오류 제공 :코드는 올바른 구문에도 불구하고, 실행되지
1>------ Build started: Project: ConsoleApplication1, Configuration: Release x64 ------
1> stdafx.cpp
1> ConsoleApplication1.cpp
1>ConsoleApplication1.cpp(6): error C2039: 'cout': is not a member of 'std'
1> predefined C++ types (compiler internal)(209): note: see declaration of 'std'
1>ConsoleApplication1.cpp(6): error C2065: 'cout': undeclared identifier
1>ConsoleApplication1.cpp(6): warning C4554: '<<': check operator precedence for possible error; use parentheses to clarify precedence
1>ConsoleApplication1.cpp(6): error C2039: 'endl': is not a member of 'std'
1> predefined C++ types (compiler internal)(209): note: see declaration of 'std'
1>ConsoleApplication1.cpp(6): error C2065: 'endl': undeclared identifier
내 코드는 다음과 같다 :
#include <iostream>
#include "stdafx.h"
void test(int x, int y)
{
std::cout << x + y << std::endl;
}
int main()
{
test(1, 2);
return 0;
}
을
감사합니다. 몰랐다. –