Declarations in middle of C code?!
Declarations in middle of C code?!
- Subject: Declarations in middle of C code?!
- From: Charles Srstka <email@hidden>
- Date: Sun, 4 Jan 2004 16:24:29 -0600
I thought this was not supposed to work in straight C code? This most
certainly did *not* work with Project Builder under 10.2, but with
XCode and gcc 3.3, I can write this code:
#include <stdio.h>
int main (int argc, const char * argv[]) {
// insert code here...
printf("Hello, World!\n");
int foo = 1;
char *bar = "foobar";
printf("foo is %i, bar is %s",foo,bar);
return 0;
}
and I get the output:
Hello, World!
foo is 1, bar is foobar
I thought this was a C++ - only feature! Has this been added in gcc 3.3
or something?
Charles
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.