Thread: calculator??

  1. #1

    Angry calculator??

    I want to make claculator that reciev the equation and after he puts '=' the calculator give him the answer..
    I created 2D array of chars... I want to fill the first column UNTIL the user puts operation (+ or - or * or /) if the prog. recieve oper. it will goto the next column..until now I didn't success Why??

    int i,u=0;
    for (i=0 i<13;i++)
    if (num[u][i]=='+')//I'll do the same with (- * / )
    }until (num[u][i]=='=');


    OK this is general idia about the prog.. Where is the problem??
    (don't care about defining variables)

  2. #2
    Registered User
    Join Date
    May 2002
    Do you care about defining arrays?


    I think you best bet would be using a string and then just input the entire thing the user enters and go from there.
    Last edited by Traveller; 05-10-2002 at 07:56 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need help modifying my calculator!!
    By Matus in forum C Programming
    Replies: 5
    Last Post: 03-25-2008, 12:03 PM
  2. GUI Calculator - Critique
    By The Brain in forum Windows Programming
    Replies: 1
    Last Post: 02-25-2006, 04:39 AM
  3. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM
  4. Need help with calculator program
    By Kate in forum C# Programming
    Replies: 1
    Last Post: 01-16-2004, 10:48 AM
  5. Replies: 2
    Last Post: 05-10-2002, 04:16 PM