I'm trying to develop an application to answer any maths questions. As a maths teacher the maths is easy for me.
But how do I print out a divide symbol to a console application? If possible I'd like to know how to use all ascii characters as well but the divide symbol is very significant.
I've tried google without success and even using unicode but it seems vastly complicated.
Is there a simple way to print out the ascii characters.
for example in Excel I use =CHAR(247) in java "\u00F7" as a string but how to achieve this in C++ seems to have beaten me, so please help.
Are you asking how to display this particular symbol or how to display anything in C++ ?
This symbol is in the ASCII table at index 246, so displaying it is not difficult: just use its value (246).
If you're not comfortable with using its value directly, you can use a proxy variable:
1 2 3 4
constchar DivideSymbol = 246;
// display the divide symbol
std::cout << "The divide symbol is " << DivideSymbol << std::endl;
cout << " / ";
printf(" / ");
puts (" / ");
//if you want to see the ascii representation:
int asci = '/';
cout << "The divide symbol is ascii character " << asci <<endl;
for (char u = '!'; u < 'z'; ++u)
{
cout << u << endl;
}