#include < iostream >
#include "main.h"
int main() {
std::cout << "x + y is: " << getInteger() << std::endl;
return 0;
}
int getInteger(int x, int y){
std::cout << "Enter an integer: ";
std::cin >> x;
std::cin >> y;
return x + y;
}
The "main.h" file, included in the same source file as the function consists of the following code:
#ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED
int getInteger(int x, int y);
#endif // MAIN_H_INCLUDED
I don't know why the title of the file is followed by "included" in caps, this was just the default format that appeared once I created a header file through the IDE.
When I try to build this function I get the following error:
error: too few arguments to function 'int getInteger(int, int)'