cµÄ×Ö·û´®ÎÊÌâ
fastshow()
{
FILE *fp;
char name[10];
char ch[512];
printf("ÇëÊäÈë´ýÏÔʾµÄÎļþÃû\n");
scanf("%s",name);
if((fp=fopen(name,"r"))==NULL)
{
printf("²»ÄÜ´ò¿ªÎļþ!\n");
exit(0);}
fgets(ch,10000,fp);
printf("%s",ch);
}
Õâ¸öº¯ÊýÖÐch[512]ÊDz»ÊǺÜÀ˷ѿռ䣬Èç¹ûÎļþÀïÃæÖ»ÓÐÒ»¸ö×Ö·ûÄÇ511×Ö½Ú²»¾ÍÀË·ÑÁËÂð£¿
»¹ÓУ¬¼ÈÈ»ÊÇ512×Ö½ÚΪʲôfgetsº¯ÊýµÄµÚ¶þ¸ö²ÎÊý¿ÉÒÔд³É10000£¿
Äܲ»ÄÜÏñvbÒ»Ñù£¬ÉùÃ÷Ò»¸östringÔÙ¸³Öµ
±ÈÈ磺string a£»fgets(ch,10000,fp)£»£¿
µÚÒ»¸öÎÊÌâ ЧÂʱȿռä¸üÖØÒª£¬ÖÁÉÙ511²»ËãÀË·Ñ
µÚ¶þ¸öÎÊÌâ°³Ò²²»ÖªµÀÄñ ûÕâôÓùý
fgets()µÄµÚ¶þ¸ö²ÎÊý˵Ã÷×î´ó¶ÁÈëµÄ×Ö·ûÊý¡£Èç¹ûÕâ¸ö²ÎÊýֵΪn£¬ÄÇôfgets()¾Í»á¶ÁÈ¡×î¶àn-1¸ö×Ö·û»ò¶ÁÍêÒ»¸ö»»ÐзûΪֹ¡£
µÚ¶þ¸öÎÊÌâ°³Ò²²»ÖªµÀ
ÎÒµÄÒâ˼ÊÇ ÍòÒ»ÎļþºÜ´ó ±ÈÈçÍøÒ³µÄÔ´ÎļþÓÐÉÏÍòµÄ×Ö·ûÎÒµÄ×Ö·ûÊý×éÊDz»ÊÇ»¹Ó¦¸ÃÓÃch[10000]?
ÓÐûÓкõķ½·¨£¬ÈÃ×Ö·ûÊý×éËæ´ý¿½±´µÄÎļþ´óС¶ø¶¨£¿
fgets(ch,10000,fp);ÓзçÏÕ¡¡
ÁíÍâ1gÄÚ´æÒ²¾Í100¿éÉÏÏ°ɣ¿511×Ö½ÚÄÚ´æÖµ²»Á˼¸¸öÇ®¡¡
ÔÚδ»ñµÃÊäÈëÇ°£¬Ôõô¿ÉÄÜÈ·¶¨×¼È·µÄ¿Õ¼ä´óС£¿
¾ÍËãÊÇstring£¬²»¹ýÊÇϵͳ×Ô¼ºÉêÇëÁÙʱ¿Õ¼ä°ïÄã¹ý¶Éһ϶øÒÑ
Èç¹ûÊǸö¾Ö²¿±äÁ¿£¬ÀË·ÑһʱҲÊÇ¿ÉÒÔ½ÓÊܵģ¬³öÁË×÷ÓÃÓò²»¾Ã»ØÊÕÁËĪ£¿
ÖÁÓÚfgets£¬ÐèÒªµÄ½öÊǸöÖ¸Õ룬ÒòΪ¿¼Âǵ½Áé»îÐÔ£¨ÎҲµģ¬Ò²ÐíÊÇд±ê×¼¿âµÄ´òî§Ë¯£©£¬Ëü²»¹ØÐÄÄã¿ÉÓÿռä´óС£¬Ö»ÖªµÀ½«fpÖеÄÄÚÈÝ°áÔËÄã¸æËßËüµÄÄÇÃ
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
ÈçÌ⣬C/C++ÖеÄexeclÔõôµ÷ÓÃдºÃµÄjava³ÌÐò£¬
execl("/opt/java1.5/bin/java","MyClass",NULL);
ÕâÑùµÄ²»ÐÐŶ¡£
²»»á.
ÔËÐÐjava³ÌÐò
ÕÒ¹¤¾ß²é¿´Ò»ÏÂÄǸö³ÌÐòµÄÃüÁîÐÐ
ËÑË÷Ï£ºjni ......
±¾ÈËÕýÔÚÓÃJava×öÒ»¸öC/S¼Ü¹¹µÄÏîÄ¿£¬
¿ÉÊÇÓÉÓÚÏîÄ¿±È½Ï´ó£¬Ç°ÆڶԼܹ¹µÄÉè¼ÆÓÈÆäÖØÒª£¬ÒòΪºóÆÚ¿ÉÄÜËæʱ»á¼Ó¸ö¹¦ÄÜ»òÕßÈ¥µôijЩ¹¦ÄÜ¡£
ËùÒÔÌصØÑ°ÇóÈçºÎÉè¼ÆC/SµÄ¼Ü¹¹Ê¹³ÌÐò¸ü¼ÓÃæÏò¶ÔÏó¸ü¼ÓÒ×ÓÚά ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
ÎÒˮƽºÜ²Ë£¬ÌáÎʵĹÀ¼ÆÒ²ºÜ¸ãЦ£¬ºÇºÇ£¬¸ßÊÖ¼ûÁ¡£
ÎÒÔÚ´úÂëÀïÃæÌí¼ÓÁËÒ»¸ö.cÎļþA£¬ÀïÃæÓÐÒ»¸öº¯Êýf£¬È»ºóÎÒÔÚÁíÍâÒ»¸ö.cÎļþBÖе÷Óô˺¯Êýf£¬µ«ÊÇ£¬BÎļþÖв¢Ã»Óаüº¬¶Ôº¯ÊýfµÄÉùÃ÷£¬Ò²¾ÍÊÇ˵ûÓаüº¬ÎļþAµÄ.h£ ......