①typedef int(arr)[5] ;
②typedef int(*arr2)[5];
③int (*arr)[5]=&b;
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <Windows.h>
//数组指针的第一种定义方式
typedef int(arr)[5];
void Test01()
{
int a[5] = { 1,2,3,4,5 };
arr *b = &a;
for (int i = 0; i < 5; i++)
{
printf("%d\n", (*b)[i]);
}
}
//数组指针的第二种定义方式
typedef int(*arr2)[5];
void Test02()
{
int a[5] = { 1,2,3,4,5 };
arr2 b = &a;
for (int i = 0; i < 5; i++)
{
printf("%d\n", (*b)[i]);
}
}
//数组指针的第三种定义方式
void Test03()
{
int a[5] = { 1,2,3,4,5 };
int(*arr3)[5] = &a;
for (int i = 0; i < 5; i++)
{
printf("%d\n", (*arr3)[i]);
}
}
int main(void)
{
//Test01();
//Test02();
Test03();
system("pause");
return EXIT_SUCCESS;
}