Miscellaneous > Programming & Networking

multifile headache

(1/1)

smokey:
I am writing an app in c++ and I have a class which I need to be able to access in two cpp files but I dont know how to do this. How would I go about to get two cpp files to use this one class? Thanks in advance  

choasforages:
err, im probably wrong, but try making something like

blah.h

and sticking the class in the header

and having

#include "./blah.h"
/*not sure about how to do it, haveint played with c++ in months*/

smokey:
it worked  
thanks again

badkarma:
a small note about the #include directive:

#include <filename> will include the given file name from the global includepath first and #include "filename" will include the given file name from the current path first. So the ./ is not neccesary if you use quotes.

Navigation

[0] Message Index

Go to full version