C++ Help compile errors


sambino

New Member
Recruit
Feb 17, 2008
3
0
0
35
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
 

KingKrool

New Member
Adept
Mar 16, 2005
3,556
71
0
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.
 

sambino

New Member
Recruit
Feb 17, 2008
3
0
0
35
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
 

Lord Nemesis

Overlord
Veteran
Jun 3, 2005
5,936
2,407
377
sambino said:
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
If you want to learn programming, you should type it in. ;)