I am wanting to make a simple blackjack game in c++ using classes. I can do this without classes, but to fully understand the language I would like to use them.
I saw this code in a source on the internet.
Can someone explain how classes work? (Specifically the scope, constructor/destructor).
Just look at the chapter that introduces classes in your book.
The constructor is called when the object is created and the destructor is called when the object is deleted. The same scope rules as for int etc. apply for classes.
So same scope, but does that mean that they have to be initialized in int main() to stay throughout the entire program?
If I call a function in main will stay in main's scope or the called function's scope?
Like I said, the same rules apply as if it were an int.
A variable defined in main is not available in other functions, unless you pass it as a parameter to other functions.
If you need variables that exist throughout the entire program, you can also use global variables or static class variables (see "singleton pattern").