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

LinuxÏÂÍê³ÉµÄÒ»¸ö×÷Òµ³ÌÐò

Îĵµ´´½¨ÈÕÆÚ£º2010-02-19
    01    // P174: 2.±à³ÌÌâ (13)²»ÀûÓÃstrcmpº¯Êý£¬×Ô¼º±à³ÌʵÏÖÁ½¸öÈÎÒâ×Ö·û´®µÄ±È½Ï¡£
    02   
    03    // The beginning of C program: test06-13.c.
    04   
    05    // Header files included.
    06    #include <stdio.h>
    07   
    08    // Macro definition.
    09    #define MAX_SIZE 100
    10   
    11    // No.1: Subroutine: int getstr ( char ch[], int size );
    12    int  getstr ( char ch[], int size )
    13    {
    14        int    i=0;
    15        if ( size >= MAX_SIZE )
    16        {
    17            printf ( "Input error, data will overflow!\n" );
    18            return  (0);
    19        }
    20        do
    21        {
    22            ch[i] = getchar();
    23            i++;
    24        } while ( ch[i-1] != '\n' );
    25        ch[i-1] = '\0';
    26        // ·µ»Ø0±íʾµ÷Óøú¯ÊýÀ´»ñÈ¡×Ö·û´®Ê±»ñÈ¡Ê


Ïà¹ØÎĵµ£º

JavaÅжÏOSÊÇlinux»¹ÊÇwindows

public class Test {
public static void main(String aa[]) {
if (System.getProperty("os.name").equals("Linux")) {
System.out.println("linux");
} else if (System.getProperty("os.name").equals("Windows XP")) {
System.out.println("win ......

linuxÏ´ÅÅ̲Ù×÷ÃüÁî

²é¿´ÏµÍ³µÄ´ÅÅÌÐÅÏ¢£º
fdisk -l
[root@localhost home]# fdisk -l
Disk /dev/hda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 979 7759395 ......

Linuxϳ£ÓÃÍøÂçÎļþ

1). /etc/sysconfig/network
Ö÷ÒªÓÃÓÚÉèÖÃÖ÷»úÃû³Æ£¨Host Name£©ÒÔ¼°ÄÜ·ñÆô¶¯Network¡£±ä¶¯´ËÎļþºóÐèÖØÆôLinux²ÅÄÜÉúЧ¡£
2). /etc/sysconfig/network-scrips/ifcfg-eth0
ÉèÖÃÍø¿¨²ÎÊý£¬ÈçGATEWAY,TYPE,DEVICE,NETMASK,IPADDR,USERCTLµÈ...
3). /etc/resolv.conf
Èç¹ûÒªÉèÖÃDNS¹¦ÄܽøÐÐÖ÷»úÃû³ÆºÍIPµÄ¶ÔÓ¦¡£ÄÇôresol ......

LinuxÏÂÍê³ÉµÄÒ»¸ö×÷Òµ³ÌÐò

Îĵµ´´½¨ÈÕÆÚ£º2010-02-19
    01    // P173: 2.±à³ÌÌâ (7)
    02   
    03    // The beginning of C program: test06-07.c.
    04   
    05    // ......

LinuxÏÂÍê³ÉµÄÒ»¸ö×÷Òµ³ÌÐò

Îĵµ´´½¨ÈÕÆÚ£º2010-02-19
£ÛÎļþ1: test06-08.c£Ý
    01    // P174: 2.±à³ÌÌâ (8)°ÑÓÐÐòµÄÁ½¸öÊý×éaºÍbºÏ²¢£¬ÒªÇóºÏ²¢ºóµÄÊý×éÒÀÈ»ÓÐÐò
    02   
    03    // The beginning of C program: test06-08.c.
 &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ