Am I doing this correctly? It is a sample program for my class.
#include <iostream>
using namespace std;
int main( )
{
int x=3, y=4;
cout << "using cast ";
cout << static_cast<double> x/y<<endl;
return 0;
}
Compiled with Dev-C++ using minGW compiler I get
parse error before '/' token
on line 10 indicating the static_cast. Changing to (double) runs okay. Is
this a problem with minGW, g++, Dev-C++, me? I have checked archives of all
mailing lists and see nothing there. Compile line is
g++.exe "D:\DPR226\My Files\Untitled2.cpp" -o "D:\DPR226\My
Files\Untitled2.exe" -l
"D:\Dev-Cpp\include\c++" -l"D:\Dev-Cpp\include\c++\mingw32" -l"D:\Dev-Cpp\in
clude" -l"D:\Dev-Cpp\include\c++\backward" -L"D:\Dev-Cpp\lib"
I don't see it. TIA
--
Gary