C/c++ socket server help?

Hey dunno if anyone will have any insight…but
Im in the proccess of creating a c++ socket server(actually it works)

im using the following code to send messages to the client


 n = read(newsockfd,buffer,255);
     if (n < 0) error("ERROR reading from socket");
     printf("Here is the message: %s
",buffer);
     sprintf(buffer,"Welcome User %d ",clientID++);
     write(newsockfd,buffer,strlen(buffer));
     write(newsockfd,"
\0",3);

and it sends the code to one specific client (newsockfd)
but i want to broadcast messages to all connected clients…
can anyone tell me how to do this?