I am migrating lots of Oracle Pro*C Code under HP-Unix to a Linux Environment.
In a program there is only such a main method defined:
main _2a((argc,argv), int argc, char * argv[])
{
...
}
I have never seen such a decalaration before - and haven't found anything with google. Anyhow, it works and from what I see is used as a main function.
Can anybody tell something about this?
Edit: Good hint - there is a macro definition:
# define _2a(list,a1,a2) list a1;a2;
Still makes no clear view (for me..)
This macro is used to make K&R C-style function definition look more like "modern" C89 definitions.
Expanded the code reads:
main (argc,argv) int argc;char * argv[];
{
...
}
Or with a better indentation:
main(argc, argv)
int argc;
char *argv[];
{
...
}
Which is an ancient way to write:
int main(int argc, char *argv[])
{
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With