2013-10-14 3 views
0

나는 다음과 같은 예제를 사용하여 C++을 배우고 있습니다. "` 'undeclared (먼저이 함수 사용)'을 입력하십시오." 이 사이트에서 몇 가지 질문을 읽었으며 함수를 선언하지 않는 것과 관련이있는 것으로 보입니다. 그러나 나는 그것을 작동시킬 수 없다. 어떤 도움이라도 대단히 감사하겠습니다.오류 : cout C++ undeclared

// 
// Program to convert temperature from Celsius degree 
// units into Fahrenheit degree units: 
// Fahrenheit = Celsius * (212 - 32)/100 + 32 
// 
#include <cstdio> 
#include <cstdlib> 
#include <iostream> 


using namespace std; 
int main(int nNumberofArgs, char* pszArgs[]) 
{ 
// enter the temperature in Celsius 
int celsius; 
cout << “Enter the temperature in Celsius:”; 
cin >> celsius; 
// calculate conversion factor for Celsius 
// to Fahrenheit 
int factor; 
factor = 212 - 32; 
// use conversion factor to convert Celsius 
// into Fahrenheit values 
int fahrenheit; 
fahrenheit = factor * celsius/100 + 32; 
// output the results (followed by a NewLine) 
cout << “Fahrenheit value is:”; 
cout << fahrenheit << endl; 
// wait until user is ready before terminating program 
// to allow the user to see the program results 
system(“PAUSE”); 
return 0; 
} 
+5

Microsoft Word에서이 질문을 입력하고 있습니까? – 0x499602D2

+0

아니요, DEV C++ IDE에서 실제로 입력하지 않았습니다. 나는 C++에서 예제를 복사했다. Dummies For 5th edition. – sms

답변

2

변경

cout << “Enter the temperature in Celsius:”; 

" 같이 있어야하기 때문에
cout << “Enter the temperature in Celsius:”; 

cout << "Enter the temperature in Celsius:"; 

오류가 발생 변경해야

“”""은 다릅니다.

+0

고마워, 효과가 있었다. – sms

+0

@sms : 너 환영합니다 :) – LihO

3

간단한 텍스트 편집기 또는 IDE를 사용하십시오. 견적이 정확하지 않습니다. 따옴표가없는

+0

팁 주셔서 감사합니다, dev에 C + + IDE를 사용하고 있습니다. – sms