|
-
Nov 24th, 2002, 09:08 AM
#1
Thread Starter
Addicted Member
Simple question
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
-
Nov 24th, 2002, 10:55 AM
#2
Frenzied Member
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
-
Nov 24th, 2002, 11:03 AM
#3
Monday Morning Lunatic
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
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|