Showing powers, cubes and squares in a console window
-
hi, I'm just a beginner at programming(c++) and I wanted to create a program to do binomial expansions easily, I have created the program and it works well. But because i'm a beginner at programming i'm using a win32 console for the program and i want to show powers, squares and cubes, which in the output of my program look like this: 2^3 0r 4^2 is there any way to show them as you would write them, like in superscript or something cos at the moment it looks a mess. Hope you understand my problem. Any answers appreciated ps if you have any recomendations on C++ books which include how to use windows forms to create a program they would be appreciated
-
hi, I'm just a beginner at programming(c++) and I wanted to create a program to do binomial expansions easily, I have created the program and it works well. But because i'm a beginner at programming i'm using a win32 console for the program and i want to show powers, squares and cubes, which in the output of my program look like this: 2^3 0r 4^2 is there any way to show them as you would write them, like in superscript or something cos at the moment it looks a mess. Hope you understand my problem. Any answers appreciated ps if you have any recomendations on C++ books which include how to use windows forms to create a program they would be appreciated
toprogramminguy wrote:
is there any way to show them as you would write them, like in superscript...
Yes, but the exponent would be a whole line above the base.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
hi, I'm just a beginner at programming(c++) and I wanted to create a program to do binomial expansions easily, I have created the program and it works well. But because i'm a beginner at programming i'm using a win32 console for the program and i want to show powers, squares and cubes, which in the output of my program look like this: 2^3 0r 4^2 is there any way to show them as you would write them, like in superscript or something cos at the moment it looks a mess. Hope you understand my problem. Any answers appreciated ps if you have any recomendations on C++ books which include how to use windows forms to create a program they would be appreciated
exponents of 2 and 3 have their own symbols in unicode. You will have to stick with x^4 for exponents of 4 (and 5, etc), but they're definitely there for 2 and 3. You will need to compile for unicode in order to use these characters. You can compile for Unicode by defining the symbols UNICODE and _UNICODE in your compiler definitions. If you go into character map and search for "superscript" then you will get 5 results, four of which may be helpful to you. Those are the characters you need to use. http://img122.imageshack.us/my.php?image=superscriptja8.jpg[^]