Thread: Math Function Input

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    85

    Math Function Input

    Hello;

    I have to write a program that allows a user to input a math function +-*?^sincostan...and I will have to draw using openGL.
    I need to figure out a way to input the function and parse it to do the math to get the points for the graph. I can get the points, but inputing the function to do the math confuses me. Any suggestions?

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    1) Read the character: +, -, *, etc.

    2) If character == '+' do something, if character == '-' do something else, etc.

  3. #3
    ... arjunajay's Avatar
    Join Date
    May 2005
    Posts
    203
    googling for 'conversion to postfix notation' might help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. dllimport function not allowed
    By steve1_rm in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2008, 03:33 AM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. C++ compilation issues
    By Rupan in forum C++ Programming
    Replies: 1
    Last Post: 08-22-2005, 05:45 AM
  4. Replies: 5
    Last Post: 02-08-2003, 07:42 PM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM