2016 - 2024

感恩一路有你

const关键字的作用 C 里const int* 与int const* 有什么区别?

浏览量:1754 时间:2021-03-17 17:53:12 作者:admin

C 里const int* 与int const* 有什么区别?

首先,如果const int是整数常量,那么指针P可以更改,但是*P不能更改。

第二:const*是一个常量索引,那么指针P是不可变的,但是*P可以更改。

我在编程中从不使用const作为关键字,以免弄巧成拙。

关键字有哪些?

关键字是计算机语言中预定义的有意义的标识符,有时称为保留字。系统定义以下关键字:

const(constant)dim(definition)as(MOD)

and(and)or(or)not(not)

if(then)else(否则)

stop(end)

Select(case)is(yes)

for(count)to(step)

byref(address)ByVal

sub(subroutine)function exit

do(loop)until(除非)while(wend)let(let)call(call)

REM(comment)

integer(integer)long(long integer)single(单精度十进制)double(双精度十进制)Boolean(布尔)[字符串(文本)

me(I)private(私有)public(公共)

const关键字的作用 java const关键字 c语言

版权声明:本文内容由互联网用户自发贡献,本站不承担相关法律责任.如有侵权/违法内容,本站将立刻删除。