• C语言void*和*p的使用


    #include <stdio.h>
    #include <stdlib.h>
    #include <limits.h>
    #include <time.h>
    #include <pthread.h>
    #include <semaphore.h>
    #include <unistd.h>
    #include <signal.h>
    #include <string.h>
    #include <stdlib.h>
    
    #define USB_CLASS_VIDEO 0x0e
    #define UVC_SC_VIDEO_INTERFACE_COLLECTION  0x03
    #define UVC_INTF_VIDEO_CONTROL   0
    #define USB_DT_INTERFACE_ASSOCIATION 0x0b
    
    typedef __signed__ char __s8;
    typedef unsigned char __u8;
    
    typedef __signed__ short __s16;
    typedef unsigned short __u16;
    
    typedef __signed__ int __s32;
    typedef unsigned int __u32;
    
    
    /* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */
    struct usb_interface_assoc_descriptor {
    	__u8  bLength;
    	__u8  bDescriptorType;
    
    	__u8  bFirstInterface;
    	__u8  bInterfaceCount;
    	__u8  bFunctionClass;
    	__u8  bFunctionSubClass;
    	__u8  bFunctionProtocol;
    	__u8  iFunction;
    } __attribute__ ((packed));
    
    
    
    static struct usb_interface_assoc_descriptor uvc_iad = {
    	.bLength = sizeof(uvc_iad),
    	.bDescriptorType = USB_DT_INTERFACE_ASSOCIATION,
    	.bFirstInterface = 0,
    	.bInterfaceCount = 2,
    	.bFunctionClass = USB_CLASS_VIDEO,
    	.bFunctionSubClass = UVC_SC_VIDEO_INTERFACE_COLLECTION,
    	.bFunctionProtocol = 0x00,
    	.iFunction = 0,
    };
    
    //0-8 ?
    int main()
    {
    
        struct usb_interface_assoc_descriptor* puvc_iad = NULL;
        puvc_iad = &uvc_iad;
    
        printf("  sizeof %d  
    ",sizeof(*puvc_iad));
        printf("p is sizeof %d
    ",sizeof(void*));
    
    
    
    
        for(;;);
        return 0;
    }
    

      

    一勤天下无难事。
  • 相关阅读:
    img[src*="same"]{}
    a[href$=".pdf"]解释
    ::selection{}
    a[href^=""]的解释
    who are you?
    天下武功唯快不破
    登录一下好吗??
    后台登录
    实验吧—简单的登录题
    hdu 1010
  • 原文地址:https://www.cnblogs.com/nowroot/p/13850168.html
Copyright © 2020-2023  润新知