I have a main cpp file where I want to use a class from another cpp file. The other cpp file, console.cpp, has a class with a constructor and a destructor. I want to use the class from console.cpp in main.cpp but I don't know how. I tried making a header file but I was very confused.
Thomas is correct, but since I already copied this to make sure it worked, I might as well just post it:
You should put the declaration of the console class and any functions you want inside the console.h header file, not the console.cpp file.
Then, the console.cpp should #include the console.h file.
You don't actually *need* to put anything in console.cpp, since you have your class declaration with inline functions, but it's good practice to separate the implementation of the functions from the declaration of the functions.
#include <iostream>
#include "console.h"
int main()
{
console con(50, 50); // NOTICE: the fix here. You must use the 2x constructor you defined.
// Because you didn't define a default constructor
std::cin.get();
return 0;
}