Question about classes

Hey, all!

I've programmed in java before but I'm new to c++ and visual studio. I was wondering how I could create a separate file from my main program which specified a class (let's say for example a bank account class) and then instantiate it inside my main program. Right now my IDE says that the source file with the code can't be found (I tried include but I thought that since the source files are in the same project I shouldn't need to do that anyway).

Help would be much appreciated!
It needs to be saved in what is called a header file which ends in ".h" or ".hpp". It also needs to either be in the system PATH or included from the local directory with #include "FILENAME.hpp" Notice that the double quotes where used to designate the headers name. This is only done if the file is included from the directory local to your working directory.

EDIT: Also, header inclusions are always done in the global scope, don't include it with in a function or anything crazy like that.
Last edited on
Ah, that clears up a lot of the c++ nuances I didn't get. Thanks for the thorough response! You just made my day a heck of a lot less frustrating.
Topic archived. No new replies allowed.