Thread: infix to postfix .... give me a hand please !!

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    8

    infix to postfix .... give me a hand please !!

    i have a problem in my project which converts the equation from infix to postfix ..... the kind of error is runtime error ,,,, and i cant determent the problem ,,,,,

    please ,,watch the attached file ,,,, and give me a hint if u can ,,,

    thanx ;;;
    Last edited by backtolife; 10-30-2006 at 12:45 PM.

  2. #2
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    when does this error happen, ie what function? what is the runtime error message? also just post the code instead of attatching the file, its easier for us

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    8
    thanx for ur reply ,,,,

    but the problem which i faced ,,,,, that the compiler does not determine the error ,,,,

    the massage appear (( General protection Exception )) ....

    so i dont know exactly the function which causes the error ....

  4. #4
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    for one your using the wrong headers, get rid of the '.h'. add 'using namespace std;' after the includes and also changed void main to int main try the program again and let us know the result. is there any line numbers that the error occurs at?

    after you make these changes paste the updated code in code tags

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    8
    i use borland C++ ,,, and (( .h)) and (( void main )) is true ,,,,

    but the probelm in Function (( InfixToPostfix )) ,,,, i disactived this function and i tested the stack ,,,, i found that the functions of stack work correctly ,,,,

    and i tested the funcions of Class (( Expression )) and i found them works correctly too ,,,,

    but when i active the function (( InfixToPostfix )) ... i faced an error ,,,,

  6. #6
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    no, standard C++ requires what i mentioned above.
    also
    after you make these changes paste the updated code in code tags
    edit please stop using (()) and ,,,,,,, its just more confusing to understand

  7. #7
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Code:
    postfix=0;
    ...
    strcat(postfix,t);
    Seems to me you just asked the strcat to add some string to the NULL pointer... hard to do without exception.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. *sigh* my postfix thread gone
    By Realio in forum C++ Programming
    Replies: 1
    Last Post: 04-26-2005, 09:30 PM
  2. Replies: 1
    Last Post: 06-29-2004, 05:23 PM
  3. Why dont 56k modems give 56kbps?
    By MovingFulcrum in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 04-24-2002, 08:15 AM
  4. Radiohead rule
    By Brian in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 01-18-2002, 07:37 PM
  5. How To Give A Font Colour ?
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 09-14-2001, 01:22 PM