-
Programming With Dev C++
Hi
Im working with dev c++ and until now Ive been writing programs in C, and compiling them without any problems in DevCPP
the problem is that when i write code in C++ , Dev C++ wont compile it.
I copy pasted a code from some C++ book and tried to compile it ,
heres the code and the the errors given by cpp:
code:
Code:
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
int celsius;
cout <<“Enter the temperature in Celsius:”;
cin >> celsius;
int factor;
factor = 212 - 32;
int fahrenheit;
fahrenheit = factor * celsius/100 + 32;
cout << “Fahrenheit value is:”;
cout << fahrenheit << endl;
system(“PAUSE”);
return 0;
}
errors:
Code:
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp: In function `int main(int, char**)':
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:14: error: stray '\147' in program
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:14: error: `Enter' undeclared (first use this function)
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:14: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:14: error: expected `;' before "the"
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:14: error: stray '\148' in program
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:25: error: stray '\147' in program
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:25: error: `Fahrenheit' undeclared (first use this function)
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:25: error: expected `;' before "value"
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:25: error: stray '\148' in program
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:29: error: stray '\147' in program
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:29: error: stray '\148' in program
C:\Documents and Settings\Owner\שולחן העבודה\5.cpp:29: error: `PAUSE' undeclared (first use this function)
Execution terminated
whats wrong ??
is there some configuration i have to do before coding in c++??
-
I think your quotes characters have the wrong ASCII value. I'm taking a shot in the dark here, that you don't have a standard US/UK keyboard? Or you copied the source from a Word or something. Try replacing the quotes with standard "" quotes and I bet it will compile just fine.
QuantumPete
-
THANKS MAN!
it was that !:D
-
Quote:
Originally Posted by
v01d
THANKS MAN!
Anytime ;)