syntax error for another program.

This is a discussion on syntax error for another program. within the C++ Programming forums, part of the General Programming Boards category; Well, here is my new stack program code. It needs a lot of work....

  1. #16
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    Well, here is my new stack program code. It needs a lot of work.

  2. #17
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    oops.

    Code:
     #include <iostream.h>
     #include    <conio.h>
    
    const max=10;
    
    int Max=10
    push(char item, char stack, char top%)
    if top < max
    stack[top]=item;
    top++;
    else overflow;
    return;
    
    int Max=10
    pop(char item, char stack, char top%)
    
    if top <0
    	underflow;
    else
    top--;
    item=stack[top];
    stack[top]=0
    return;
    
    int main ()
    char item
    char choice
    
    cout << "input function (A to add, B to delete.)
    cin >>choice
    
    if choice=A
    	push(item)
    else pop(item)
    thats better.

  3. #18
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    That code doesn't even come close to compiling. Example, main needs curly braces.
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  4. #19
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    Yeah I know. I had to essentialy throw out the old program because my teacher said it was to advanced for my class. Now I have this.

  5. #20
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    So fix it so it at least matches what C++ is supposed to look like.
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  2. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  3. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 08:51 AM
  4. Syntax for adding a program to autoexec.bat...
    By Sebastiani in forum C Programming
    Replies: 5
    Last Post: 06-18-2002, 01:38 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

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