|
-
September 29th, 1999, 08:28 PM
#1
a generous compiler ?
can some1 tell me why i don't have to malloc for the struct ?
thanks
struct A {
int a ;
int b ;
} ;
int bbb(struct A *A_struct) {
(A_struct[0]).a = 6543 ;
(A_struct[4]).a = 6666 ;
return 0 ;
}
int main() {
struct A *A_struct ;
bbb(A_struct) ;
printf("a is %d\n",(A_struct[0]).a) ;
printf("a is %d\n",(A_struct[4]).a) ;
return 0 ;
}
result : a is 6543
a is 6666
Signature (up to 100 characters) You may use Markup in your signature
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|