zoukankan      html  css  js  c++  java
  • 实验c语言不同类型的指针互用(不推荐只是学习用)

    #include <stdio.h>
    
    int main(int argc, char *argv[])
    {
        printf("Hello, world
    ");
        char c[4];
        int *p = NULL;
        p = (int *)(&c[0]);
        *p = 0X01020304;
        printf("%d--%d--%d--%d--",c[0],c[1],c[2],c[3]);    
        return 0;
    }

    结果是:4--3--2--1

    指针步长,字符串占一个字节,整型变4个字节.

    其他知识点 intel的大端小端

  • 相关阅读:
    互斥量
    读写锁
    死锁
    pthread
    线程
    守护进程
    信号捕捉
    信号集
    信号
    mmap
  • 原文地址:https://www.cnblogs.com/fps2tao/p/8331421.html
Copyright © 2011-2022 走看看