954,174 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

MultiThreading

I need help with running two function at the same time .
MultiThreading?

void Function1(int n)
{
while(n<10)
{
n++;
}
}
void Function2(int n)
{
while(n<20)
{
n++;
}
}

If these are the 2 functions,can someone tell me how I can start the 2 togetherfrom int main().I haven't been able to get it right from the internet.
Please type the code for this,if you can.

nerdinator
Light Poster
29 posts since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

>MultiThreading?
Multithreading, spawn multiple processes, or fake your own threading. The latter isn't recommended for real code, but it can be fun.

>Please type the code for this,if you can.
I'm not going to do your work for you, dude. You didn't even say what platform you're running on, which means any code you're given might not compile.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 
I'm not going to do your work for you, dude. You didn't even say what platform you're running on, which means any code you're given might not compile.

I am using visual c++.
This is not my final application,and I am only trying to learn the code concerned to these simple functions,so I can apply it elsewhere.
See if you can help me out. :S

nerdinator
Light Poster
29 posts since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You