Hey guys i could use some clarification as to how this is done. Most if not all examples i have seen have the class written above the main in the same cpp file. My professor says we should have it in a different file so it can be reused by others which makes sense. How do you have the class in a different file and allow the file containing the main be able to use that class?

I can post the particular program im trying to accomplish this with if needed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.