聲明 (編程)

維基百科,自由的百科全書

計算機編程中,聲明是一種指定標識符屬性的語言結構[1]聲明最常用於子程序變量常量,但也可用於其他實體,例如枚舉[1]聲明通常還能指定資料類型(對於變量和常量)以及類型簽名(對於函數)[2][1]

參考文獻[編輯]

  1. ^ 1.0 1.1 1.2 "A declaration specifies the interpretation and attributes of a set of identifiers. A definition of an identifier is a declaration for that identifier that:
  2. ^ Mike Banahan. 2.5. Declaration of variables. GBdirect. [2011-06-08]. (原始內容存檔於2022-04-12). [A] declaration [...] introduces just the name and type of something but allocates no storage[...].