i'm doing work on chat massenger and facing difficulty to run multiple threads at the same time.
here is the sample code.
void menu();
void groupChat();
void personalChat();
int main()
{
sf::Thread thread(&menu());
thread.launch();
}
void menu()
{
do
{
cout<<"P for group chat"<<endl;
cout<<"p for group chat"<<endl;
cout<<"Enter choice";
switch( choice )
{
case 'p':
sf::Thread thread(>oupChat);
thread.launch();
case 'g':
sf::Thread thread(&personalChat);
thread.launch();
}
}while( choice != 'p' choice != 'g' );
}
void groupChat()
{
};
void personalChat()
{
};
in my programm
after menu when he selects a choice, next display of menu wait the termination of the selected thread.
while i want to show menu right after when a menu is selected.
plz reply soon.