Re: full in the blank , making use of a[10] to outputcontent of i
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Thu, 15 Feb 2007 12:31:50 -0800
Kenneth Brody <kenbrody@xxxxxxxxxxx> writes:
"liking C lang.Chinese" wrote:[...]
#include<stdio.h>
main()
{
int i;
char a[10];
scanf("%d",&i);
_________________
_________________\\*full in the blank , making use of a[10] to
outputcontent of i*\\
printf("%s",a);
}
can anyone help me?
Aside from the nitpicking of other parts of this thread, it has yet
to be pointed out that "a[10]" does not exist. You have declared a
as an array of 10 chars, with subscripts running from 0 through 9.
Any attempt to access "a[10]" invokes undefined behavior.
I suspect that the "a[10]" in the comment doesn't refer to element 10
of the array, but to the object a which is an array of 10 elements. I
think it's intended to be an informal notation, similar to the common
use of "foo()" to refer to a function named "foo" rather than to the
result returned by the function "foo".
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- full in the blank , making use of a[10] to outputcontent of i
- From: liking C lang.Chinese
- Re: full in the blank , making use of a[10] to outputcontent of i
- From: Kenneth Brody
- full in the blank , making use of a[10] to outputcontent of i
- Prev by Date: Re: Hello and *++* ?
- Next by Date: Re: Accessing web with a C program
- Previous by thread: Re: full in the blank , making use of a[10] to outputcontent of i
- Next by thread: Re: full in the blank , making use of a[10] to outputcontent of i
- Index(es):
Relevant Pages
|