I see my issue now, I haven't coded in a long time but I can't believe I made such a basic mistake
Thanks everyone but I have a new issue related to my original issue
How do I make a function that can work with a variable declared in the main?
#include <iostream>
using namespace std;
void function();
int main()
{
int x = 5;
return 0;
}
void function()
{
cout << x << endl;
}
I get an error at second last line saying x is out of scope, I understand why I just don't know how to solve this