# Thread: printing out a string in mathematical formula

1. ## printing out a string in mathematical formula

hey guys, i hav this stupid assignment in which the user enters an equation in the regular c notation like (sqrt((x+4)/(x+sin(x/15))...)and im supposed 2 print it out in the regular math notation..it's a gui recursive drawing fn or smth,and it's said 2 be easier after the rpn ( working on the postfix i mean ) which is no problem 2 me, but im so clueless about this drawing thing, so any help wd be greatly appreciated

2. I believe You want to know about infix notation to postfix notation. You can read many article on this as one is here. Infix to Postfix

3. Originally Posted by maven
I believe You want to know about infix notation to postfix notation. You can read many article on this as one is here. Infix to Postfix
actually no, i can do the infix to postfix trick, but it's required after wards to somehow draw the initial equation in the plain mathematical formula, like there's no sqrt but the symbol of square root and fractions inside, no pow(,), it should be printed as a base and an index..

4. Is the extended ASCII chart what you're looking for? (hint: second table)

5. here it goes, i should develop a program that takes an equation from the user written in c notation,(e.gow(x,2)) and then print it out as x2 and the same goes for the rest of math functions in c,input in c notation, output in math notation(the way u write equations in the math class), so far i only know it's a recursive gui function..some say it's easier 2 work on it after the rpn, i no how 2 rpn it but i dont find it helpful..do u find it stupid?? cuz i do..

6. Every special symbol imaginable is available in unicode, but to do something like sub/superscripting, or square root or long division notation or something, you do need a gui. Those are platform specific and it won't be a matter of just learning a couple of functions -- you will have to learn the basics of the library first -- so I'd make sure that's what the assignment is supposed to be about and what gui libs you are suppose to use.

7. yep, dat's pretty much the idea..of course sub,+,* are doable but for the division, it's a night mare really.. im kinda of a rookie programmer, so is there any specific library that can do that?? cd u plz mention a name??

8. I really really think you should double check the nature of the assignment. GUI programming is not trivial; it is going to take you a LOT of time -- possibly weeks -- to get all that worked out as a novice. So unless you are taking some course where you've missed most of the classes, etc, and are now trying to catch up, I doubt that is what is expected. It would also a pretty weird project IMO, because in order to grade it, the instructor would have to be familiar with the library, so they would have told you which one to use, because there is zero chance they are going to be familiar with all the possibilities.

If you are really determined to use a GUI, the library depends on the platform you are programming for (windows, linux, mac).

9. u just said my opinion of my gui programming course, but the instrucrtor thinks we're able 2 do it with that primitive course, im actually going good except 4 that division part, the sqrt n power r fine but if there's a division it just goes wrong, so wt im trying 2 do is just 2 get familiar with the techniques of such stuff,im using window xp n yes im positive that is the nature of the assignment

10. I'm not much of a windows user or programmer, but I believe the native API for this is just called "win32":

Tutorial: Getting Started

It may or may not have built in support for doing stuff like displaying math, if not there is probably a plugin around for it. But I'm warning you again: this is almost certainly the wrong path to be going down. You should really talk to your instructor or someone and let them know what you are doing just in case. As I mentioned, this will almost certainly take you several weeks to do, so you have plenty of time to ask before you waste all of it .

11. FWIW... there are truetype fonts with mathematical symbols etc... that can be printed from windows GDI.

12. this is wt i hav done so far, im trippin in some few points still like how 2 get the new x n y after recursion, anyonE who's willing to help, check the attachments

13. Originally Posted by sar90
this is wt i hav done so far, im trippin in some few points still like how 2 get the new x n y after recursion, anyonE who's willing to help, check the attachments
Writing code in .h files is a major no no in C...

You seriously need to visit a couple of tutorials...

Do the reading, do the exercises, learn...

Teach Yourself C in 21 Days -- Table of Contents

When you finish that one, go for this one...

theForger's Win32 API Tutorial

14. Originally Posted by CommonTater
Writing code in .h files is a major no no in C...

You seriously need to visit a couple of tutorials...

Do the reading, do the exercises, learn...

Teach Yourself C in 21 Days -- Table of Contents

When you finish that one, go for this one...

theForger's Win32 API Tutorial
well the thing is i dont have that much time now, the deadline is just 24 hours from now, so i just need 2 figure out the nxt move not start from scratch , specially with the gui

15. Originally Posted by sar90
well the thing is i dont have that much time now, the deadline is just 24 hours from now
Code:
```#include<stdio.h>
enum grade { F, D, C, B, A };
struct bettingpool
{
float wager;
char name[ BUFSIZ ];
};

int main( void )
{
struct bettingpool[] =
{
{ F, 100.00, "Quzah" },
};
...
return 0;
}```
Any takers?

Quzah.

Popular pages Recent additions