c语言嵌入式linux高级编程 -...

Download C语言嵌入式Linux高级编程 - img.bss.csdn.netimg.bss.csdn.net/7be47ddcf28c3f60aa16cc5b59a47bf6.pdf · C语言测试(4) •代码分析 •使用C-free、GCC、VC++6.0、visual

If you can't read please download the document

Upload: dinhdat

Post on 06-Feb-2018

303 views

Category:

Documents


8 download

TRANSCRIPT

  • CLinux

  • C

  • C(1)

    C

    ()()

  • C(2)

    sizeof sizeof ( int)

    sizeof

    3264Windows7

    3264X86 CPU

    81632ARM

    Turbo CkeilGCC-32GCC-64

    gcc m323264

    gcc m646432

  • C(3)

    i=1,j=2;

    printf(%d\n, i++*i++);

    i+++j;

  • C(4)

    C-freeGCCVC++6.0visual studio

    VC++6.0console.cpp.c

    int main()

    {

    int i; //

    int a[0];

    printf("hello world!\n");

    int j;

    for(int k=0;k

  • C(5)

    Linux int * data_copy ( int *p)

    {

    int buffer[8192*1024];

    memcpy ( buffer, p, 8192*1024);

    return buffer;

    }

  • C(6)

    Linux(Linux4.4) #define stamp(fmt, args...) pr_debug("%s:%i: " fmt "\n", __func__,

    __LINE__, ## args)

    #define container_of(ptr, type, member) ({ \

    const typeof(((type *)0)->member) * __mptr = (ptr); \

    (type *)((char *)__mptr - offsetof(type, member)); })

    struct urb { struct usb_iso_packet_descriptor iso_frame_desc[0];}

    urb->transfer_flags &= ~(URB_DIR_MASK | URB_DMA_MAP_SINGLE |URB_DMA_MAP_PAGE );

  • Linux

  • C(6)

    staticinline

    volatileconst

    #definetypedef

  • C

  • C

  • C

    C

    C

  • C

    C

    C

  • C

    C

    I/O

    Linux

    Linux

  • C

    C

  • Linux

    C

  • @

    QQ475504428

    QQ 3284757626