Math Function Input

This is a discussion on Math Function Input within the C++ Programming forums, part of the General Programming Boards category; Hello; I have to write a program that allows a user to input a math function +-*?^sincostan...and I will have ...

  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,662
    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, 01: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, 06: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21