I am creating a server/client socket program and am in the process of making a method to print server input.
Here's my code:
void *admin_handler (void *ptr) {
char strBuf [100000];
const char strExit [20] = "Server: terminated.";
while(1) {
scanf ("%s", strBuf);
int i;
for (i=0; i < nClient; i++){
if (strBuf == "Exit"){
write (nFDList [i], strExit, strlen (strExit) + 1);
}
else {
write (nFDList [i], strBuf, strlen (strBuf) + 1);
}
}
};
}
When I execute, though, even when I type in "Exit", it still executes the else statement. How can I modify the if statement to execute when I type "Exit"?