What is the difference between “keyword” and “reserved word”?

前端 未结 10 2431
再見小時候
再見小時候 2020-12-13 05:54

What\'s the difference between a keyword and a reserved word?

For example, in the proposal for concepts in C++ one can read the following statement

10条回答
  •  有刺的猬
    2020-12-13 06:29

    Just to show that the distinction is very meaningful:

    Not in all languages are all keywords reserved words. In Fortran it is possible to do this:

    if if then then else else
    

    In this case, the keywords are not reserved, but depending on context can be interpreted by the compiler as variables.

提交回复
热议问题