在我写的程序中,我已经声明了这个变量:
#define SIZE 5
long int clockNum [SIZE] = {98401, 526488, 765349, 34645, 127615};
Run Code Online (Sandbox Code Playgroud)
如果我想打印这个,那么输出是:
098401
526488
765349
034645
127615
Run Code Online (Sandbox Code Playgroud)
我该怎么做?我尝试了下面的声明,但它似乎没有工作..
for(i = 0; i < SIZE; i++)
{
printf ("%li\n",&clockNum[i]);
}
return(0);
Run Code Online (Sandbox Code Playgroud)
我得到的输出看起来像:
-1076048964
-1076048960
-1076048956
-1076048952
-1076048948
Run Code Online (Sandbox Code Playgroud)
&从printf中删除并让我们看看
for(i = 0; i < SIZE; i++)
{
printf ("%li\n",clockNum[i]);
}
Run Code Online (Sandbox Code Playgroud)
这里printf &给出变量的地址值