Archived

This topic is now archived and is closed to further replies.

vnebojsa

C++.....

Recommended Posts

Hi everyone, I started learning C++ and I think I learned enough to create a little calculator. It''s not hard but I''d like to put some graphics in it. I want classic calculator look. How to do that. I know I have to draw that first but how to combine C++ code and graphics. Please help me! Nebo

Share this post


Link to post
Share on other sites
If I was making the calculator graphical, I would use Windows. Basically make an interface (your program interface can be a dialog)... then handle presses of the buttons. You can use a string to store the numbers... then append them to the end of the current string. When the user presses an operator button, you convert the string to a float... and store the operation and number in a static then use them to calculate the result when the user presses another operation, or equals... the "current" number, becomes the result. I hope this explains it for you... there is a good site that does exactly this, and more. This book is a VERY worthwhile read.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by dmounty
<A href="http://www.relisoft.com/book/index.htm">This book</A> is a VERY worthwhile read.

Why do you keep suggesting that book?? You must be connected with the publishers/authors or something.

Share this post


Link to post
Share on other sites