degree symbol
I get the error "truncation of constant value" for the line below. How can I correct this? I want to make a degree symbol. Thank you.
|
cout<<"Rotation of "<<Angle<<static_cast<char>(248)<<endl;
|
Vanessatse, the following works on my XP computer with code::blocks and the MinGW compiler:
1 2 3 4 5 6 7 8 9 10
|
#include <iostream>
using namespace std;
int main ()
{
float angle;
angle =0;
cout<<"Rotation of "<<angle << static_cast<char>(248) << endl;
cin.get ();
return 0;
}
|
But I had to declare "angle" and assign an initial value of zero to stop getting a very weird large number from coming up! Cheers, Don
Last edited on
I don't get any error on that line. If the compiler is definitely indicating a problem with that particular line, you might try:
|
static_cast<unsigned char>(248)
|
Topic archived. No new replies allowed.