C++ Help compile errors

sambino

Recruit
im trying to get this programm to work using the most recent version of dev-C++ heres the code its from the c++ for dummies book
//
// 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;
}
it wont compile it has errors can someone point them out for me and maybe fix them so i know what has been changed i would really appreciate it here is my compile log

_______________________________________________

Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Documents and Settings\sam\My Documents\temperature.cpp" -o "C:\Documents and Settings\sam\My Documents\temperature.exe" -g3 -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3
C:\Documents and Settings\sam\My Documents\temperature.cpp: In function `int main(int, char**)':
C:\Documents and Settings\sam\My Documents\temperature.cpp:14: error: stray '\147' in program
C:\Documents and Settings\sam\My Documents\temperature.cpp:14: error: `Enter' undeclared (first use this function)
C:\Documents and Settings\sam\My Documents\temperature.cpp:14: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\Documents and Settings\sam&linda\My Documents\temperature.cpp:14: error: expected `;' before "the"
C:\Documents and Settings\sam\My Documents\temperature.cpp:14: error: stray '\148' in program

C:\Documents and Settings\sam\My Documents\temperature.cpp:25: error: stray '\147' in program

C:\Documents and Settings\sam\My Documents\temperature.cpp:25: error: `Fahrenheit' undeclared (first use this function)
C:\Documents and Settings\sam\My Documents\temperature.cpp:25: error: expected `;' before "value"
C:\Documents and Settings\sam\My Documents\temperature.cpp:25: error: stray '\148' in program

C:\Documents and Settings\sam\My Documents\temperature.cpp:29: error: stray '\147' in program
C:\Documents and Settings\sam\My Documents\temperature.cpp:29: error: stray '\148' in program
C:\Documents and Settings\sam\My Documents\temperature.cpp:29: error: `PAUSE' undeclared (first use this function)

Execution terminated
 
Unable to process double quotes.

Let me guess, you copied and pasted this from a webpage? Manually replace the double quotes. Delete them, and then type them in from the keyboard. I think you'll see the error go away.
 
OMG thank you so much it worked something so simple i guess i should"nt have been so lazy and typed it in but ill remember that
 
Back
Top