Why does a programming language need keywords?

前端 未结 13 954
野性不改
野性不改 2021-02-01 03:25

For example (in C):

int break = 1;
int for = 2;

Why will the compiler have any problems at all in deducing that break and fo

13条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-01 03:33

    Since it's tagged C, the original C language was such that by default any variable was defined as type int.

    It means that foo; would declare a variable of type int.

    Let's say you do break;. So how does the compiler know whether you want to declare a variable named break or use the keyword break?

提交回复
热议问题