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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:25:45+00:00 2026-06-18T14:25:45+00:00

first I know this is a terrible thing to do as it may require

  • 0

first I know this is a terrible thing to do as it may require large amounts of memory copying… but it needs to be done because of specifications I have been given.

Anyway, I am trying to pass a string by reference and a vector by value as it will be edited then destroyed and then the original will be used again.

Here is the function prototype

int print (const string& findme,const string& command,const string& command2,const string& command3, int n, vector<string> list)

and here is my call, all variables are of the correct type.

print (special,command,command2,command3,n,temp);

Everything compiles and runs when I do not attempt to call the function… but when I do I get this error:

a2p1.cc: In function âint main(int, char**)â:
a2p1.cc:85: error: no match for call to â(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >) (std::string&, std::string&, std::string&, std::string&, int&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)â

SO I was wondering… how should I be passing these strings and the vector to the function the strings can be passed by reference but I need a copy of the vector, any syntax help would be very helpful! Thanks!

Here are the variables

    int n;

    string command = "rr";
    string command3 = "null";
    string command2 = "f";
    string japan;
    string special;
    special = "fnord";
    string textFileName;

    vector<string> list;
    vector<string> print;

And here is the call to the function, on line 83:

while (cin >> inputtemp)
{
...

if ((inputtemp == "p")){

print (special,command,command2,command3,n,list);

}// If
}// While
  • 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-18T14:25:47+00:00Added an answer on June 18, 2026 at 2:25 pm

    You have both a function and a variable named print.

    You’re not actually calling the print function.

    Rename the variable.

    (Your function prototype is correct. It will do what you describe)

    Look again at your error to see this. (I removed the templates to make it simpler)

    error: no match for call to (std::vector) (std::string&, std::string&, std::string&, std::string&, int&, std::vector&)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Excuse me first. because i don't know this is question is valid or not.
I know this may sounds silly but I would like to create function that
First of all, I know this question has already been asked but the answer
first I know this question has been posted alot of times on internet, but
Well, first I know that this question was already asked several times. But I
I know this question might sound a little cheesy but this is the first
Terrible title, I know... This works and gives me what I'm looking for, but
I know this might sound easy. I thought about using the first dot(.) which
This is my first post. I know this topic has been discussed before in
First of all I don't know if this is the right approach. I want

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.