Graphing Calculator..

hey..i was wondering how hard it would be to write a graphing calculator. like, what kind of understanding would it take to make such a thing? and how would dealing with variables (such as: Y1 = 3x-2) work? is anyone aware of a tutorial dealing with the knowledge needed? i did a search on google but i'm unsure what to search for and the one i did didn't come up with anything..

You would need to convert the equation from infix to postfix. You would then need to solve the postfix expression for incremental values of the independent variable. Once you have a sufficient number of graph points, then you can plot them on your graph window.

>> You're probably not going to find a tutorial on "How to make a graphing calculator program".
hmm...

is anyone aware of a tutorial dealing with the knowledge needed?

lol i wouldn't like that kind of tutorial, i'd like a tutorial that will drill into my brain the individual steps of the different functions needed so that i can combine them and make the final product.
i'm also quite glad there isn't such a tutorial as it would make the task much more dull and typical.

pretty good at parsing strings.. i'd say i'm not bad. i like math i've written a hangman program..? lol its fun but i'm guessing by dealing with graphics you mean something less bitmap related..?

infix? postfix? mm..i'll look these up. what should i use for making the graph window?

You could always use the GDI draw functions. If you already know how to use a graphics API like OpenGL, then you could use that as well.

If you are not already experienced with using the Windows API, then using GDI to create a graph may be a little too ambitous for you. On the other hand, attempting overly abitious projects can lead to a massive growth in your programming expertise.

I've made a few programs using thw Win API.. i'll look up the GDI draw functions.

but i agree, overambition usually generates much learning. hence the reason i'm here. lol but i've never written anything in OpenGL...or DirectX. i've check out some tutorials on OpenGL but thats about as far as that went. lol

..i even get the error when using the code from winprog.net so i'm thinking its my compiler... ? I'm using Dev-C++ 4.9.9.2, Windows XP Pro SP2, and i haven't changed anything since the last time i compiled something.
I also have Dev-C++ installed to my flash drive and i have Visual C++ 2005 Express Edition Beta 2 installed on my pc and i get the same error with all of the above, "There was a problem creating the window. Program creation has failed."

First of all, you should zero out your WNDCLASSEX structure before you fill it. If you are still having a problem with CreateWindow() returning NULL, then make sure your resource IDs are valid. Consider using some defaults instead:

To avoid excessively coding and re-coding a window I just made one file that was a blank window. I use that as a template when I make other programs using windows similar to that, otherwise I rewrite the whole thing. If you want here it is attached:

The reason for this is because if the way you have it, it would have to declare all three of those vars every time the window calls that function. Which would be a lot of times.

I'm not sure what you mean by "hard on the memory" and I doubt that making those variables global is worthwhile . Even if there is some slight performance boost (it might translate to a few less assembly instructions, I guess), you now have three global variables that stay in memory as long as the application is running. And besides that, they retain their values each time the function is called. If someone needs that, they can always use static variables.

In any case, it just seems like bad style to me. If you don't need variables outside of a function, don't declare them outside of a function.

"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)