Why does a programming language need keywords?

前端 未结 13 701
野性不改
野性不改 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:54

    I guess it look very weird if not impossible to write the parser. E.g

    int break = 1;
    while (true) {
       // code to change break
       if (!break) break;   // not very readable code.
    }
    

提交回复
热议问题