标题: SOCKET报文问题 [打印本页] 作者: wjla1 时间: 2008-7-31 18:13 标题: SOCKET报文问题 long file_stream;
char *filename = "d:\\baowen.txt";
Action()
{
int NumberOfBytes;
int i, total = 0;
memset(&buffer[0], 0, sizeof(buffer));
if ((file_stream = fopen(filename, "r")) == NULL )
{
lr_error_message("Cannot open %s", filename);
return -1;
}
whiel((feof(file_stream) )== 0)
{
ch = fgetc(file_stream); /* Read in the next character */
buffer = ch; /* Place the new char at the end of the buffer */
}
/* Add null to end the buffer converting it to a string */
buffer = NULL;
lr_message("buffer= %s\n, buffersizeof = %d\n", buffer, sizeof(buffer));