Stop Microsoft

Miscellaneous => Programming & Networking => Topic started by: smokey on 7 September 2002, 20:48

Title: multifile headache
Post by: smokey on 7 September 2002, 20:48
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  (http://smile.gif)
Title: multifile headache
Post by: choasforages on 7 September 2002, 21:01
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*/
Title: multifile headache
Post by: smokey on 7 September 2002, 21:03
it worked  (http://smile.gif)
thanks again
Title: multifile headache
Post by: badkarma on 11 September 2002, 17:17
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.