Groovy hepcat Sean Zhang was jivin' on 20 Apr 2006 02:13:06 -0700 in
comp.lang.c.
what is wrong in the code?'s a cool scene! Dig it!
The following is the code:
struct S {
int i;
int * p;
};
void main()
main() should return int, not void.
There's no such thing as Struct. Remember, C is a case sensitive
language. "Struct" (with a capitol "S") is not the same as "struct".
Fine.
Fine.
BZZZZT! Undefined behaviour. p[1] doesn't exist.
Fine.
BZZZZT! Undefined behaviour. s.p[1] doesn't exist.
Fine.
You really need to return a value (after changing main()'s return
type). You can portably return 0, EXIT_SUCCESS or EXIT_FAILURE (the
latter two being macros defined in stdlib.h).
}
I don't why cause the problem occurred in the last sentence?
I realise English is probably not your first language, but I don't
know what that's supposed to mean. There are problems throughout this
code. This could not even have compiled. It is, no doubt, not the code
you actually tried to compile. Don't retype code here. Copy and paste,
so we are sure to see the real code.
--
Dig the even newer still, yet more improved, sig!
http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?