使用typedef 定义数组

来源:互联网 发布:linux系统chown指令 编辑:程序博客网 时间:2024/06/05 08:09

c语言使用typedef可以给数据类型定义别名

#include<stdio.h>typedef int type;main(){type a;//定义整型的变量a}

定义一维数组

#include<stdio.h>typedef int type[5];main(){type a; //这个a就如同普通情况下的 int a[3]}

定义二维数组

#include<stdio.h>typedef int type[5];main(){type a[3]; //这个a就如同普通情况下的 int a[5][3];}


0 0
原创粉丝点击