You guys are going in the wrong direction with the 32 bit and 64 bit. I was referring to the compiler. In C++ you can compile in x86 and x64. Does it matter whether I use x86 or x 64?
Right now I am getting problems with line 15 and 17.
Severity Code Description Project File Line Suppression State
Error C2371 'temp_c': redefinition; different basic types prog. 12 C:\VS Projects\prog. 12\prog. 12.cpp 15
Severity Code Description Project File Line Suppression State
Error (active) E0065 expected a ';' prog. 12 C:\VS Projects\prog. 12\prog. 12.cpp 17
Severity Code Description Project File LSeverity Code Description Project File Line Suppression State
Error C2065 '”': undeclared identifier prog. 12 C:\VS Projects\prog. 12\prog. 12.cpp 17 ine Suppression State
Error C3873 '0x201c': this character is not allowed as a first character of an identifier prog. 12 C:\VS Projects\prog. 12\prog. 12.cpp 17
Severity Code Description Project File Line Suppression State
Error C2065 '“The': undeclared identifier prog. 12 C:\VS Projects\prog. 12\prog. 12.cpp 17
You guys are going in the wrong direction with the 32 bit and 64 bit. I was referring to the compiler. In C++ you can compile in x86 and x64. Does it matter whether I use x86 or x 64?
No, it doesn't matter. We're not going in the "wrong direction" - instead, focus on producing some C++ code which obeys the language rules. We can address any further issues later on.
mbozzi, I don't see any spelling errors in the code I put here.
I used the term spelling errors to mean syntax errors. Then, I enumerated every such error in your program and gave you a corrected version.
I can't help you if you don't bother to read what I wrote. Help us help you.
//#include "pch.h"
#include <iostream>
#include "math.h"
using namespace std;
int main()
{
9. float temp_f{}, temp_c{};
11. cout << " Enter temperature in Fahrenheit " << endl;
13 cin >> temp_f;
15 temp_c = (temp_f - 32) * (5.0 / 9.0);
17 cout << “The temperature in Celsius is ” << temp_c << "\n" ;
}
A couple of the errors:
Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "“The" is undefined prog. 12 C:\VS Projects\prog. 12\prog. 12.cpp 17
Severity Code Description Project File Line Suppression State
Warning C4244 '=': conversion from 'double' to 'float', possible loss of data prog. 12 C:\VS Projects\prog. 12\prog. 12.cpp 15
Severity Code Description Project File Line Suppression State
Error C3873 '0x201c': this character is not allowed as a first character of an identifier prog. 12 C:\VS Projects\prog. 12\prog. 12.cpp 17
You guys are spewing stuff here and being aggravating. I don't have the things on my keyboard that you have. I don't know where they are. But you write like I know these things. I am writing the code in VS, not a word processor.
I came here looking for help. This is the beginner forum. So dump the attitude.
its not on the keyboard.
software (ms word, internet browsers, others) can inject unicode ugly quote symbols that are not what c++ accepts as quotes. The only quote you need is the " which is next to enter on normal english speaker keyboards. If that is what you are using and its compiling for you on your system, it may have just gotten adjusted in your browser or something. It happens.
its in the code you posted:
“The temperature in Celsius is ” << temp
vs
"The temperature in Celsius is " << temp
see the difference, side by side, visually? see that left and right are different symbols?
Wherever there is a double quote (") go back over it and type it in again from the only double quote that you have on your keyboard.
At the moment you have two distinct types of double quote in your code, so you clearly didn't type them in from the same software package using the same keyboard. Perhaps you tried cutting and pasting some lines of code from a book; who knows?
Nobody here is "spewing stuff" or "being aggravating" or using "attitude". Actually, there seems to be a remarkable degree of patience!
OK I'll use the same quotes I used before. I redid the quotes and it worked! Now does this mean that I have to do this every time I write a program in Visual Studio?
Under normal circumstances, no, you shouldn't need to think about it. Those Unicode quote characters probably came from copying the text from another application; they were not the result of typing in visual studio.
> How do I make exe files
If your code successfully built and ran, then visual studio already made the exe