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 8279325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:17:56+00:00 2026-06-08T09:17:56+00:00

I am getting abpve error at line str.append(ch); in below code. I basically want

  • 0

I am getting abpve error at line str.append(ch); in below code.

I basically want to append str with each char ‘ch’.

If someone know the issue please correct my error.

int extract(unsigned char data, char i); // Signature of extract function


void decoded(istream& input,ostream& output)
    {   
        int cnt;
        int x;

        input.read((char*)&x,sizeof(x));


        cout<<x;
        cnt=x;
        string str;
        char ch;
        for ( ; ; ) 
        {
            char c;

            input.read((char*)&c,sizeof(char));

            if ( input )
            {
                //read_bit(c,output);
                for (int i=7; i>=0; i--)
                {     
                    if(cnt)
                        {
                        cnt--;
                        ch=(char)(((int)'0')+extract(c, i));

                        str.append(ch);// I am getting error at this line.

                        if(huffmanFindTable[str])
                        {
                            output.write((char*)&(huffmanFindTable[str]),sizeof(char));
                            str.clear();
                        }
                        else
                        {
                        }

                    }
                }
            }
            else
            break;
        }



    }
  • 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-08T09:17:58+00:00Added an answer on June 8, 2026 at 9:17 am

    Like the compiler says, there is no member function with the signature

    str.append(ch);
    

    You can use either

    str.append(1, ch);
    

    or the simpler

    str.push_back(ch);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting the above error on the ToList() line of the code below if
I keep keep getting the above error when I run the code below. All
I'm getting the error above from Char 1 of the 4th line... No clue
Getting the above error in following code. How to rectify it. Thanks. Please look
I keep getting the above error message, even if I comment out the line
I am using Visual Studio 2005. While debugging code I am getting following error
I'm getting this message each time I compile my project: RunIPhoneUnitTest.sh: line 92: 31389
I'm getting the error above on my tx:annotation-driven line, but I've declared the namespace
I am getting the above error and I'm not sure how to fix it,
I am getting the above error whenever I test on an emulator, but not

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.