zoukankan      html  css  js  c++  java
  • typedef使用

    typedef:为已有的数据类型改名

    typedef   已有的数据类型   新名字 ;

    #include <stdio.h>
    #include <stdlib.h>
    
    typedef int INT ;//将int改名INT
    
    /*typedef int INT ;//将int改名INT
     *INT i ; ------> int i ;
     *
     *typedef IP int * ;//将int * 改名IP
     *IP p ;-----> int *p ;
     *
     *typedef int ARR[6]; //将int[6]改名为ARR
     *ARR a ;----> int a[6] ;
     *
     *struct node_st
     *{
     *      int i ;
     *      float f ;
     *}
     * typedef struct node_st NODE ;//将一个结构体struct node_st 改名为NODE
     * NODE a ;----->struct node_st a ;
     *
     *typedef struct node_st *NODEP ;//指向结构体的指针 *p
     *NODEP p ; ----->struct node_st *p
     *
     *typedef struct
     *{
     *      int i ;
     *      float f ;
     *}NODE,*NODEP ;
     *
     *typedef int FUNC(int) ;//给函数类型int(int) 改名为FUNC;
     *FUNC f ; --->int f(int) ;
     *
     * typedef int *FUNCP(int) ;//将一个指针函数改名为FUNCP
     * FUNCP p ; --->int *p(int) ;
     *
     * typedef int * (*FUNCP)(int) ;//将一个指向指针函数的指针改名为FUNCP
     * FUNCP p ; --->int *(*p)(int) ;
     */
    
    void int main()
    {
            INT i = 10 ;
            printf("%d
    ",i);//打印10
    
            exit(0);
    }
  • 相关阅读:
    Codeforces Round #573 (Div. 2) C. Tokitsukaze and Discard Items
    Codeforces Round #573 (Div. 2) B
    练习2
    练习1
    上机练习4
    上机练习3
    上机练习1
    JAVA第一次作业
    es document的强制替换、创建、删除
    es 返回定制化的_source数据
  • 原文地址:https://www.cnblogs.com/muzihuan/p/5220650.html
Copyright © 2011-2022 走看看