定义数组类型及数组类型指针
来源:互联网 发布:js控制css过渡效果 编辑:程序博客网 时间:2024/06/06 21:41
定义数组类型及数组类型指针
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct _Teacher
{
char name[10];
int age;
}Teacher;
int main1()
{
int i = 0;
typedef int Myarray[5];//定义了一个数组类型
Myarray myarray;
for (i = 0; i < 5; i++)
{
myarray[i] = i;
}
for (i = 0; i < 5; i++)
{
printf("%d\n",myarray[i]);
}
system("pause");
return 0;
}
void main()
{
int i;
typedef int Myarray[5];
Myarray *parray = NULL;//定义了一个指向数组的指针
int a[5];
parray = &a;//二级指针
for (i = 0; i < 5; i++)
{
(*parray)[i] = i;
}
for (i = 0; i < 5; i++)
{
printf("%d\n", (*parray)[i]);
}
system("pause");
}
void main()
{
int i;
/*int(*mypoint)[5];
int c[5];
mypoint = &c;*/ //直接定义指针变量
typedef int (*Myarray)[5];//定义了一个数组指针类型
Myarray mypoint;
int b[5];
mypoint = &b;
int a[5];
mypoint = &a;
for (i = 0; i < 5; i++)
{
(*mypoint)[i] = i;
}
for (i = 0; i < 5; i++)
{
printf("%d\n", (*mypoint)[i]);
}
system("pause");
}
- 定义数组类型及数组类型指针
- oracle定义数组类型
- 数组类型指针
- C++数组类型基础及数组指针基础
- 【C语言提高33】数组指针类型定义
- 指针数组,数组指针,指针函数,函数指针的区别及类型间的转换
- oracle 之定义数组类型
- 把数组定义为类型
- typedef 定义数组类型用法
- typedef 定义数组类型用法
- 函数指针数组+枚举类型
- 数组、指针与引用类型
- 类型组合(数组、指针)
- 有关指针的数组类型
- C 语言中的数组类型和数组指针类型.
- void 类型指针以及指针数组
- 定义struct/struct定义在哪里/函数返回指针类型/指针数组与数组指针/{}里是局部定义/fabs、abs
- /*测试数组的类型及指针类型所占的字节长度*/
- 博客代码美化(SyntaxHighlighter)
- 算法 —— 归并排序
- 数值分析--矩阵QR分解的三种方法
- Git 使用规范流程
- uvalive 6957 Hyacinth 题目难理解
- 定义数组类型及数组类型指针
- python __new__、__init__、__call__
- poj-2442Sequence
- 算法 —— 堆排序
- Fragment放置后台很久(Home键退出很长时间),返回时出现Fragment重叠解决方案
- PCI、PCI-x,PCI-E兼容以及他们之间的区别详细图解
- JavaScript和jQuery图片上传预览
- 学习ubuntu之快速搭建LNMP环境
- 程序员常去的14个顶级开发社区