数组指针--2
来源:互联网 发布:彩票概率计算软件 编辑:程序博客网 时间:2024/05/22 08:25
#include"stdafx.h"
#include<iostream>
using namespace std;
void main()
{
// int a[5][10]={231,223,433,44,235,36,7,8,9,10,11,12,13};
int a[10]={231,223,433,44,235,36,7,8,9};
int *p,**p2; //指针和向指针的指针
int (*pp)[10]; //指向数组的指针
int *pp2[10]; //指针数组
cout<<sizeof(pp)<<endl; //输出4
cout<<sizeof(pp2)<<endl; //输出40
for(int i=0;i<10;i++)
{
cout<<*(pp+1);
}
for(int i=0;i<10;i++)
pp2[i]=&a[i];
for(int i=0;i<10;i++)
for(int j=i;j<10;j++)
{
int k;
if(*pp2[i]>*pp2[j])
{
k=*pp2[i];*pp2[i]=*pp2[j];*pp2[j]=k;
}
}
for(int i=0;i<10;i++)
cout<<*pp2[i]<<endl; //从小到大输出a[0]的内容
getchar();
}
#include<iostream>
using namespace std;
void main()
{
// int a[5][10]={231,223,433,44,235,36,7,8,9,10,11,12,13};
int a[10]={231,223,433,44,235,36,7,8,9};
int *p,**p2; //指针和向指针的指针
int (*pp)[10]; //指向数组的指针
int *pp2[10]; //指针数组
cout<<sizeof(pp)<<endl; //输出4
cout<<sizeof(pp2)<<endl; //输出40
for(int i=0;i<10;i++)
{
cout<<*(pp+1);
}
for(int i=0;i<10;i++)
pp2[i]=&a[i];
for(int i=0;i<10;i++)
for(int j=i;j<10;j++)
{
int k;
if(*pp2[i]>*pp2[j])
{
k=*pp2[i];*pp2[i]=*pp2[j];*pp2[j]=k;
}
}
for(int i=0;i<10;i++)
cout<<*pp2[i]<<endl; //从小到大输出a[0]的内容
getchar();
}
- 数组指针--2
- 数组与指针2
- 指针访问数组2
- 数组和指针(2)
- 数组指针示例2
- 数组与指针2
- 指针数组、数组指针
- 指针数组/数组指针
- 指针数组/数组指针
- 数组指针 指针数组
- 指针数组,数组指针
- 数组,指针,数组指针
- 数组,指针,数组指针
- 指针数组&数组指针
- 指针数组&数组指针
- 数组指针 指针数组
- 指针数组/数组指针
- 数组指针&指针数组
- 什么是ER图
- “互联相约与爱同行”让爱洒满人间
- 使用InstallSheild过程中还没有解决的问题
- 经济寒冬,如何收获井喷式财富?
- SQL Server 2005 管理并发数据访问
- 数组指针--2
- mysql的cluster&replication结合
- 希望你认识我
- java 的转义字符,在正则表达式中应用
- 基于英文单词的快速HASH索引算法--选择自 tarkey 的 Blog
- javascript
- Struts Tiles框架实例
- C++热点问题一席谈 -- Bjarne Stroustrup 2005新春专访 (荣耀)
- jQuery-show()与html()及hide()用法 学习笔记四