This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

局部变量,全局变量的问题



我看双核的样例中,两个CPU都定义了相同的变量,有的在CPU1定义成为全局变量并赋了初始值,CPU2也同样的定义成为全局变量并赋了初始值。

有的在CPU1定义了全局变量,却在CPU2定义成了局部变量。

请问:

两个CPU  定义的相同的变量是同一个变量吗?      地址是否相同?