Hello, I have a working struct return from a function that only works from the main.cpp file...I would like to move the function to a header file...Here is the code as it is now, in working condition:
If you get errors, you always have to copy and paste them into your post (edit: you also have to read them first. Because they tell you what's wrong).
However, you need to make the function static inline if you want to move it to the header, otherwise you'll get multiple definition errors.
And about this: for (j = i + 1; ... - always declare counter variables inside the for loop, unless you need to know the value the loop stopped at.
Well, in the header file the class Pairs is undeclared, that's why you get these errors.
Note that there is std::pair. You probably should be using std::pair<int,int> instead of your own class.
And never import entire namespaces in a header file.
How do you recommend I declare struct 'Pairs" when it has been declared in the main.cpp file..? The purpose of this class is to determine the pairs by comparing variables...(at the moment the values within the 'numbs' array are set, but they will be replaced with variables)...this is why I can't simply use std::pair.