Re: full in the blank , making use of a[10] to outputcontent of i



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.
.



Relevant Pages

  • Re: Window Management
    ... (* prompt is a string resource identifier specifying the string ... PROCEDURE YesNoCancel(prompt: ARRAY OF CHAR; ... VAR INOUT response: ARRAY OF CHAR): BOOLEAN; ...
    (comp.lang.ada)
  • Window Management
    ... (* prompt is a string resource identifier specifying the string ... PROCEDURE YesNoCancel(prompt: ARRAY OF CHAR; ... VAR INOUT response: ARRAY OF CHAR): BOOLEAN; ...
    (comp.lang.ada)
  • Re: Pointer
    ... require in input a pointer char: ... unsafe public static extern int OpenFile; ... What is it pointing to exactly, is it pointing to a "Unicode character" array or is it pointing to a "Single byte character" array or is it pointing to something else? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Pointer
    ... require in input a pointer char: ... unsafe public static extern int OpenFile; ... What is it pointing to exactly, is it pointing to a "Unicode character" array or is it ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Problem with va_ macros and arrays of arrays
    ... > the arrays passed to a ... > specific char, somewhat similar to what the standard function ... that with an array of struct, or possibly a pointer to a dynamic array ... > As I'm still a beginner in C without a copy of the standard I ...
    (comp.lang.c)