Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux c ±àÒëͨ²»¹ý£¬Çë¸ßÊÖ°ïÎÒ¿´ÏÂÄÄÀïµÄ´í£¿

int _send()
{
int fd,size;
char fname[1024],buffer[4096];

/*ÊäÈëÒª´«ÊäµÄÎļþ*/
printf("ÇëÊäÈëÄúÒª´«ÊäµÄÎļþ·¾¶:\n");
gets(fname);
/*´ò¿ªÎļþ*/
fd = open(fname,O_RDONLY,0);
/*¶ÁÈ¡Îļþ*/
while((size = read(fd,buffer,4096))>0)
{
/*µ÷ÓÃclientº¯Êý£¬´«ÊäÎļþ*/
// client(buffer);
printf("%s",*buffer);
}
if(size == -1)
{
fprintf(stderr,"Read Error: %s\a\n",strerror(errno));
exit(-1);
}
/*´«Êä½áÊø,¹Ø±ÕÎļþ*/
close(fd);
printf("´«ÊäÍê±Ï£¡\n");
£ý
/*ÎÒÓÃgcc -c clien client.c±àÒ룬
*Ìáʾ´íÎóÐÅÏ¢:
*
*client.c: ÔÚº¯Êý¡®_send¡¯ÖУº
*client.c:58: ´íÎó£º ÔÚµ÷ÊÔÆ÷ÀïÖØÐÂÔËÐд˳ÌÐò
*client.c:58: ´íÎó£º ÔÚµ÷ÊÔÆ÷ÀïÖØÐÂÔËÐд˳ÌÐò
*client.c:58: ´íÎó£º ÔÚµ÷ÊÔÆ÷ÀïÖØÐÂÔËÐд˳ÌÐò
*client.c:58: ´íÎó£º expected declaration or statement at end of input
*/
ÊDz»ÊÇûͷÎļþ°¡

printf("%s",*buffer); ÕâÀïÊDz»ÊÇ´íÁË

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>

Í·Îļþ¡£
{{--


Ïà¹ØÎÊ´ð£º

Á½¸öCÎļþµÄÎÊÌâ

ÒÔǰÔÚVCÀïÃæ½¨Ò»¸ö¹¤³Ì£¬¶¼Ö»ÓÃÒ»¸ö .c Îļþ£¬×òÌìÔÚÒ»¸ö¹¤³ÌÀïÓÃÁËÁ½¸ö .cÎļþÁË£¬Óöµ½ÎÊÌâÁË£¬Çë´ó¼ÒÖ¸µã¡£±ÈÈ磺
File1.c Fil ......

²ËÄñÇó½â:cͼÐÎÎÊÌâ

#include <stdio.h>
#include <graphics.h>
void main()
{
  int x0,y0,x1,y1,driver,mode,i;
  driver=VGA;
  mode=VGAHI;
  initgraph(&driver,&mode,&qu ......

C\C++ÈçºÎ¼ÆË㺯ÊýµÄµ¼Êý

C\C++ÈçºÎ¼ÆË㺯ÊýµÄµ¼Êý,±¾ÈËÐÂÊÖ£¬Ïëд¸ö³ÌÐò£¬µ«ÊDz»ÖªµÀÈçºÎÏÂÊÖ£¬»¹Íû¸ßÊÖÖ¸µãÒ»¶þ£¬Ð»¹ý¡£
Õâ¸ö¡­¡­

¸úº¯ÊýµÄ¾ßÌåÐÎʽÓйذɣ¬ÄѵÀÄãÏë±à³ö¸ö¡°ÍòÄÜ¡±µÄÇ󵼺¯Êý£¿

°³ÉÏѧʱÏë¹ý×Ô¶¯ÍƵ¼¹«Ê½£¬ºóÀ´ ......

´ÓÎļþ¶ÁC´®µÄÎÊÌâ

¶¨ÒåÁË

ifstream fin("in.txt");

±ÈÈçÎļþÊ×ÐÐÊÇÒ»¸öÊý×Ö£¬µÚ¶þÐÐÊÇÒ»´®×Ö·û¡£

int M;
char* str;

fin>>M;
fin>>str;

M¿ÉÒÔ¶Á³öÀ´£¬str×ÜÊÇÎÞ·¨¶ÁÈ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ