comments causing build fail

Just getting re-aquainted with C++, so I did this..
//
// 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;
}

THE BUILD RETURNS THIS!!!

1>------ Build started: Project: Conversion, Configuration: Debug Win32 ------
1>Build started 3/28/2014 3:18:14 AM.
1>InitializeBuildStatus:
1> Touching "Debug\Conversion.unsuccessfulbuild".
1>ClCompile:
1> Conversion.cpp
1>c:\...conversion.cpp(14): error C2065: '“Enter' : undeclared identifier
1>c:\...conversion.cpp(14): error C2146: syntax error : missing ';' before identifier 'the'
1>c:...conversion.cpp(14): error C2065: 'the' : undeclared identifier
1>c:...conversion.cpp(14): error C2146: syntax error : missing ';' before identifier 'temperature'
1>c:...conversion.cpp(14): error C2065: 'temperature' : undeclared identifier
1>c:\...conversion.cpp(14): error C2146: syntax error : missing ';' before identifier 'in'
1>c:\...conversion.cpp(14): error C2065: 'in' : undeclared identifier
1>c:...conversion.cpp(14): error C2146: syntax error : missing ';' before identifier 'Celsius'
1>c:...\conversion.cpp(14): error C2065: '”' : undeclared identifier
1>c:\...conversion.cpp(25): error C2065: '“Fahrenheit' : undeclared identifier
1>c:\...\conversion.cpp(25): error C2146: syntax error : missing ';' before identifier 'value'
1>c:\...conversion.cpp(25): error C2065: 'value' : undeclared identifier
1>c:\...conversion.cpp(25): error C2146: syntax error : missing ';' before identifier 'is'
1>c:\...conversion.cpp(25): error C2065: '”' : undeclared identifier
1>c:\...conversion.cpp(29): error C2065: '“PAUSE”' : undeclared identifier
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.87
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Build Summary
-------------
00:00.998 - Failed - Debug Win32 - Conversion\Conversion.vcxproj

Goodness,... I forget why I wanted to start programming again!!!
ya so, if anyone knows why my comments are causing the build fail, please feel free to make as many jokes on me you can muster!
Its not your comments, it is your string literals. Its probably because you are using an angled form of the double quotes ( “ ), you should be using just the plain ones ( " ).

Also, please you code tags, it makes it much easier to read.
Wow thanks for the reply NT3, I hadn't figured on anyone actually responding and just seeing if the forum would post (I'm new here). Thanks for the advise though.. I just wiped everything clean (over the past 2 days) and reinstalled everything. Hey that was the trick though, I wrote that in another editor and pasted it over, the quotes were the trouble. I knew it had to be something little and you picked it right up... so moving one.. I have some unresolved externals already.. straight out of the pack and they still can't get the install program right. Also, I don't know what you mean by "Also, please you code tags, it makes it much easier to read." "please 'USE'?.. " and I'm not familiar with "code tags". Thanks though, a lot.

Alright! needed to put "mainCRTStartup" as an entry point in the linker props.. so it builds and runs, shows a window that says "press any key to continue..." and that's it. No text, cin, cout, the pause is there but that's it. Maybe I should just start back with doing console apps until I absorb the mountain of bs to put up a window in windows? Whatever it takes. For 14 grand, I'm going to be a programmer. I was just kinda hopeful that things would have gotten a little easier out of the box since I bought Boreland C++ in '97.
Last edited on
I don't know what you mean by "Also, please you code tags


[code]std::cout << "Hello, World!" << std::endl;[/code]
== std::cout << "Hello, World!" << std::endl;
Topic archived. No new replies allowed.