在做了数组的行为与C的指针? [英] when does a array act as a pointer in c?

查看:187
本文介绍了在做了数组的行为与C的指针?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,数组名可以作为指针(尽管这是一个转换的形式),但我的问题是,是否存在这样阵列作为一个指针其他一些实例。

i know that the array name could be used as a pointer(although it's a converted form), but my question is , Is there some other instance where array acts as a pointer.

推荐答案

从技术上讲,数组名从来没有作为一个指针。一个
前pression与数组类型(这可能是一个数组名)将转换
到指针随时数组类型是不合法的,但指针类型是。
和数组作为函数参数的声明转化
成指针的声明。 (这意味着该名称不是
数组名,但有指针​​的名字。尽管出场。)

Technically speaking, an array name never acts as a pointer. An expression with array type (which could be an array name) will convert to a pointer anytime an array type is not legal, but a pointer type is. And the declaration of an array as a function parameter is converted into a declaration of a pointer. (Which means that the name isn't an array name, but a pointer name. Despite appearances.)

这篇关于在做了数组的行为与C的指针?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆