Ask coding questions

← Back to all posts
Creating header files for a C++ class
kmcrae

I have a classroom set up for my C++ students and we are now learning about creating our own classes. I need to be able to define the class structure in a file saved as a header file. Can this be done on Repl.it? I tried just naming it with the .h extension but I get all kinds of errors related to not knowing what the Class type is, which I am sure relates to the header file.

Voters
SaberSahabzada
Zuyingg
kmcrae
Comments
hotnewtop
mat1

The error should mention what file and line it's on. Can you please give us the full error and repl link? Thanks.

SPQR

Could you link the repl? That way we'll be able to see exactly what's wrong :)

kmcrae

@SPQR I actually got it to work now. Thanks for replying. It was just an inconsistent naming issue that I didn't see at first.

JerryLatham

How did you get it to work? I am trying to do the same thing, but the lecture is using code [email protected]

BillyLandis

@kmcrae can you share your solution?

MajidGomainy

@SPQR Though is not related! How can we use the OpenGL for c++ in repl.it?