Message from C, C++ talks

June 2019

— Initialize it with (size, true) and you are done

— Also, it is worth noting that *std::vector<bool> works differently compared to other template<typename T> std::vector*

Message permanent page

— Like?

— BTW thanks for this

— 

It is allowed to store 8 booleans per byte or any setup it likes for storing the booleans given that they are still in contiguous memory

— Is nature a keyword in C++?

— Ok it's not

— Anybody know any idea to use c programming sockets to communicate with multiple client vice versa?

— Using TCP protocol

— Yes

— Communicate with 1 client at the time is easy

— Take a look on long polling

— Probably he's having the issue he's responding on the port being connected to, making it unavailable to other clients

Message permanent page

— You know, Emile, you can respond from a different port on the request to keep the host-port open for multiple connections?

Message permanent page

— 

#include <iostream>
int main()
{
char letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char oletters[] = "0123456789";
char random_name[5];
for(int i = 0; i < 5; i++)
{
switch(i)
{
case 0: random_name[i] = letters[rand() % 26]; break;
case 1: random_name[i] = letters[rand() % 26]; break;
case 2: random_name[i] = oletters[rand() % 10]; break;
case 3: random_name[i] = oletters[rand() % 10]; break;
case 4: random_name[i] = oletters[rand() % 10]; break;
default: break;
}
}
std::cout << "Random name thus generated is: " << random_name;
return 0;
}

Please check is this program correct?

Message permanent page