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

  • SEARCH
  • Home
  • 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 8727723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:29:20+00:00 2026-06-13T08:29:20+00:00

Please have a look at the following code #include <iostream> #include <iomanip> #include <vector>

  • 0

Please have a look at the following code

#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <sstream>


using namespace std;
bool isEven(int);


 int number;
 vector<int> inputNumbers;
 string line;

int main()
{    
    cout << "Please enter numbers: ";

    getline(std::cin,line);
    istringstream iss(line);

    while(iss>>number)
    {
        inputNumbers.push_back(number);
    }

    size_t vectorSize = inputNumbers.size();

    for(int i=0;i<vectorSize;i++)
    {
        cout << "Result for number " << i << "is: " << isEven(inputNumbers(i));
    }


}

bool isEven(int number)
{
    if(number%2 == 0)
    {
        return true;
    }
    else
    {
        return false;
    }
}

When I run this program, it gives the following error

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/yohan/Documents/NetBeansProjects/Excersice 6'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/excersice_6.exe
make[2]: Entering directory `/cygdrive/c/Users/yohan/Documents/NetBeansProjects/Excersice 6'
mkdir -p build/Debug/Cygwin-Windows
rm -f build/Debug/Cygwin-Windows/EvenNumbers.o.d
g++    -c -g -MMD -MP -MF build/Debug/Cygwin-Windows/EvenNumbers.o.d -o build/Debug/Cygwin-Windows/EvenNumbers.o EvenNumbers.cpp
EvenNumbers.cpp: In function `int main()':
EvenNumbers.cpp:32: error: no match for call to `(std::vector<int, std::allocator<int> >) (int&)'
make[2]: *** [build/Debug/Cygwin-Windows/EvenNumbers.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-Debug.mk:79: recipe for target `build/Debug/Cygwin-Windows/EvenNumbers.o' failed
make[2]: Leaving directory `/cygdrive/c/Users/yohan/Documents/NetBeansProjects/Excersice 6'
nbproject/Makefile-Debug.mk:62: recipe for target `.build-conf' failed
make[1]: Leaving directory `/cygdrive/c/Users/yohan/Documents/NetBeansProjects/Excersice 6'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed


BUILD FAILED (exit value 2, total time: 1s)

This won’t happen if I remove the function call to isEven(). Why is this happening? Please help!

  • 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-13T08:29:22+00:00Added an answer on June 13, 2026 at 8:29 am

    Problem solved. I have replaced

    inputNumber[i]

    with

    inputNumber(i)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please have a look at the following code #include <iostream> using namespace std; int
Please have a look at the following code #include <iostream> #include <iomanip> #include <vector>
Please have a look at the following code #include <iostream> #include <iomanip> #include <vector>
please have a look at the following code #include <iostream> #include <iomanip> #include <vector>
Please have a look at the following code. Main.cpp #include <iostream> #include Maximum.h using
Please have a look at the following code #include <iostream> #include <iomanip> #include <cmath>
i have following code for heapsort #include <iostream> using namespace std; void exch(int a[],int
I have the following code: #include <iostream> #include <string> void main() { std::string str;
Please have a look at the following code namespace Funny { class QuesionsAndAnswers {
Please have a look at the following code DatabaseHandler.java public List getDetails(String name) {

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.