UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » warning: character constant too long & incompatible type

#1 2004-01-10 04:22 PM

dooker
Member
Registered: 2004-01-06
Posts: 4

Re: warning: character constant too long & incompatible type

int send_menu(int sockfd, int max_fd)
{

  short msg_type;
  short msg1_len;
  short msg2_len;
  short msg3_len;
  char msg1[25];
  char msg2[25];
  char msg3[25];


  msg1 = '--------------------';
  msg2 = 'LIST OF ONLINE USERS';
  msg3 = '--------------------';


  msg_type = htons(3);
  write(sockfd, &msg_type, sizeof(short));
 
  
  msg1_len = htons(strlen(msg1));
  write(sockfd, (char *)&msg1_len, sizeof(short));
  write(sockfd, msg1, strlen(msg1));

  msg2_len = htons(strlen(msg2));
  write(sockfd, (char *)&msg2_len, sizeof(short));
  write(sockfd, msg2, strlen(msg2));


  msg3_len = htons(strlen(msg3));
  write(sockfd, (char *)&msg3_len, sizeof(short));
  write(sockfd, msg3, strlen(msg3));
  
} /* end of send_menu function */

Offline

#2 2004-01-10 09:24 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,847
Website

Re: warning: character constant too long & incompatible type

Offline

  • Index
  • » C
  • » warning: character constant too long & incompatible type

Board footer

Powered by FluxBB