calculator??

This is a discussion on calculator?? within the C++ Programming forums, part of the General Programming Boards category; I want to make claculator that reciev the equation and after he puts '=' the calculator give him the answer.. ...

  1. #1
    Unregistered
    Guest

    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??
    [code2]

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

    [/code2]

    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
    Posts
    317
    Do you care about defining arrays?

    Edit:

    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, 03: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, 09:48 AM
  5. Replies: 2
    Last Post: 05-10-2002, 04:16 PM

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