const關(guān)鍵字的作用 C 里const int* 與int const* 有什么區(qū)別?
C 里const int* 與int const* 有什么區(qū)別?首先,如果const int是整數(shù)常量,那么指針P可以更改,但是*P不能更改。第二:const*是一個(gè)常量索引,那么指針P是不可變的,
C 里const int* 與int const* 有什么區(qū)別?
首先,如果const int是整數(shù)常量,那么指針P可以更改,但是*P不能更改。
第二:const*是一個(gè)常量索引,那么指針P是不可變的,但是*P可以更改。
我在編程中從不使用const作為關(guān)鍵字,以免弄巧成拙。
關(guān)鍵字有哪些?
關(guān)鍵字是計(jì)算機(jī)語(yǔ)言中預(yù)定義的有意義的標(biāo)識(shí)符,有時(shí)稱為保留字。系統(tǒng)定義以下關(guān)鍵字:
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(單精度十進(jìn)制)double(雙精度十進(jìn)制)Boolean(布爾)[字符串(文本)
me(I)private(私有)public(公共)