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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:08:54+00:00 2026-05-29T10:08:54+00:00

So once again I need some help with this program for class. Maybe its

  • 0

So once again I need some help with this program for class. Maybe its that I’m tired but I can’t seem to find the logic error I’m sure I’ve made here. Here is my code:

#include "Book.h"


using namespace std;

void add (char*, char*, int);
void remove (int&);
void list ();

int Count;

Book Bookshelf [4];

int main ()
{   
    string In;
    string N;
    string A;
    int Y;
    int Num;

    do
    {
        cout << "Bookshelf> ";
        getline(cin, In);

        if (In.compare("add") == 0)
        {
            cout << "Bookshelf> Enter book: ";
            cin >> N >> A >> Y;
            add (N,A,Y);
        }

        else if (In.compare ("remove") == 0)
        {
            cout << "Bookshelf> Select number: ";
            cin >> Num;
            remove (Num);
        }

        else if (In.compare("list") == 0)
        {
            list ();
        }

    } while (cin != "quit");

    return 0;
}

void add (string N, string A, int Y)
{
    if (Bookshelf[4].IsEmpty() == false)
        cout << "Error!" << endl;
    else
    {
        Bookshelf[Count] = Book (N,A,Y);
        Count++;
    }
    cout << "Bookshelf> ";
}

The error occurs at the line add(N,A,Y); but for the life of me I can’t tell why it is saying that. They both look like std::strings to me. Can anyone explain this to me?

  • 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-05-29T10:08:54+00:00Added an answer on May 29, 2026 at 10:08 am

    You have forgotten to modify your prototype at the top of your file.

    It still says

    void add (char*, char*, int);
    

    It should be

    void add (string, string, int);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Once again I need some help. I'm working with a table that contains 3
I need your expertise once again. I have a java class that searches a
Once again, I need some help and I appreciate you all for being here
I am once again looking for some help. I have found this stopwords script
Once again I need some much appreciated help from the experts :) I am
Once again I need some help. I'm creating a multiple file upload function with
I think I've seen this done once, but I cannot find it again after
I received some great help here the other day and hope once again I
I need some help with a query (sorry, I'm not too good at this!)
Once again I'm asking this question, and still can't find any reasonable solution. I

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.