What should be the output to the following code ? I am confused because I am getting a slightly different output everytime . Any other advise would also be appreciated .
#include<iostream>
#include<SFML\System.hpp>
void apple_thread(void *data)
{
using namespace std;
for(int i = 5 ; i<11 ; i++)
{
cout<<"I have "<<i<<" apples . "<<endl;
}
}
void main()
{
sf::Thread thread(&apple_thread);
thread.Launch();
using namespace std;
for(int i = 5 ; i<11 ; i++)
cout<<"I have "<<i<<" oranges . "<<endl;
getchar();
}