Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8935025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:54:08+00:00 2026-06-15T09:54:08+00:00

I am doing a program to check for balanced brackets and parenthesis, etc. I

  • 0

I am doing a program to check for balanced brackets and parenthesis, etc. I created a char to store the info, and when I push the char it works, but it won’t allow me to pop. Anyone know what I can do? Our prof gave us the header file so I cannot change it from int to char in the pop/push function. But I’m curious what I can do to make this work?

void push(int);
void pop(int &);

char ch,i;
IntStack x(50);
int count = 0;

while (fin>>ch)
{
if (ch == '[' || ch=='{' || ch=='(')
{
      x.push(ch);    //this works
  count++;
}

if (ch==']' || ch=='}' || ch==')')
{
  x.pop(ch);    //this brings an error, i also tried x.pop(ch&) and didnt work too
  count--;
}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:54:08+00:00Added an answer on June 15, 2026 at 9:54 am

    Pass an integer into pop that represents ch, then set ch according the results passed back from the integer.

    int PopVar;
    Pop(PopVar);
    ch = PopVar;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a minesweeper program for school, but i keep getting this error
I am doing a simple JSP program to connect with MySQL DB. But it's
I am basically doing a tutorial but my program seems to have errors that
Doing this in a console program: object x = new string(new char[0]); If one
I'm doing my program in many steps. One of them is to use gevent
I am doing my program in cocos2d. I am using NSDate to get the
I am doing a recursive program and I am getting an error about conflicting
I'm doing a small program with sencha touch. I deployed it on my webserver
i, I have to run about a 100 tests on my program and doing
This program I'm doing is about a social network, which means there are users

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.