#define ARR_SIZE sizeof(arr)/ sizeof(arr [0]) [英] #define ARR_SIZE sizeof(arr)/sizeof(arr[0])
问题描述
下面的代码没有打印出原因为什么?
代码是正确的。 plz解释逻辑
#include< stdio.h>
int arr [] = {10,20,30,40, 50};
#define ARR_SIZE sizeof(arr)/ sizeof(arr [0])
void main()
{
for(int i = -1; i<(ARR_SIZE-1);)
printf(" Hello%d \ n" ,arr [++ i]);
}
谢谢&问候
Vinu
" Vinu" < 6 ********* @ yahoo.com>写道:
以下代码没有打印出原因为什么?
代码是正确的。
你所展示的代码至少在两个方面是不正确的;并且没有
要求Usenet上的作业答案。
HTH;手。
Richard
Vinu< vi ********* @ yahoo.com>写道:
for(int i = -1; i<(ARR_SIZE-1);)
提示:通常的算术转换。
-
Stan Tobias
mailx`echo si *** @FamOuS.BedBuG.pAlS.INVA LID | sed s / [[:upper:]] // g`
查看专家C程序,深层C分泌答案。
The following code doesn''t prints anything why it is?
The code is correct. plz explain the logic
#include <stdio.h>
int arr[] = {10,20,30,40,50};
#define ARR_SIZE sizeof(arr)/sizeof(arr[0])
void main()
{
for(int i= -1; i < (ARR_SIZE-1); )
printf("Hello %d\n", arr[++i]);
}
Thanks & Regards
Vinu
"Vinu" <vi*********@yahoo.com> wrote:
The following code doesn''t prints anything why it is?
The code is correct.
The code you showed is not correct, in at least two aspects; and neither
is asking for homework answers on Usenet.
HTH; HAND.
Richard
Vinu <vi*********@yahoo.com> wrote:
for(int i= -1; i < (ARR_SIZE-1); )
Hint: Usual Arithmetic Conversions.
--
Stan Tobias
mailx `echo si***@FamOuS.BedBuG.pAlS.INVALID | sed s/[[:upper:]]//g`
see the Expert C ProgramIng , deep C secretes for the answer.
这篇关于#define ARR_SIZE sizeof(arr)/ sizeof(arr [0])的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!