PDA

Click to See Complete Forum and Search --> : Simple question


FrEaK85
Nov 24th, 2002, 08:08 AM
Hi,

I'm new to c++ (verry new ;) ) and i 'm using Microsoft Visual C++ 6.0. I have a file named main.cpp & a file named multithreading.cpp, how do i access the functions from multithreading.cpp in main.cpp???

Thanks,

Walter Brebels

SteveCRM
Nov 24th, 2002, 09:55 AM
add them both to the project....
in the menu should be something like
Project->add to project->from file

then in main say
#include "multithreading.cpp"

im pretty sure thats how it goes :cool: :)

parksie
Nov 24th, 2002, 10:03 AM
Nope, never include a .cpp file.

Create a corresponding header file for multithreading.cpp (multithreading.h). Give it header guarding (search forums), and just the prototypes of your functions/classes. Then all the function *code* goes into the .cpp file.

Then make all 3 files are in your project, include multithreading.h into main.cpp, and you should be sorted :)