Array increment operator in C

前端 未结 7 570
暖寄归人
暖寄归人 2020-11-28 10:13

I don\'t understand the results of following code:

#include 
#include 
int main()
{
   int a[4]={1, 3, 5, 6};
   //suppose a is         


        
7条回答
  •  余生分开走
    2020-11-28 10:40

    I think the first output will be depedent on how the integer type is represented in your computer. If a single integer occupies 4-bytes in memory, the output should be 2018, i.e. 2010+2*4. The second printf can cause a compilation error.

提交回复
热议问题