R
ravi
Hello everybody,
I am writing a small application which does some work before the user
main function starts execution.
I am trying to #define the main function.
But the problem is that,
the main () function by user may be of different types
1. main()
2.main(int argc)
3. main(int argc, char *argv[])
How to #define all these three possibilities. And there is not
guarantee that the user is going to use the same names "argc &argv"
all the times. we need also know the argments name if needed to access
them.
I am trying to do this.
#define main(a,b) main(a,b){
my_function();
user_main(argc,argv);
}
user_main(a,b)
But this will not work if we have to deal with above listed 3 cases.
and also the agrument names problem.
Can I have some suggestions on this?
Thanks in advance.
I am writing a small application which does some work before the user
main function starts execution.
I am trying to #define the main function.
But the problem is that,
the main () function by user may be of different types
1. main()
2.main(int argc)
3. main(int argc, char *argv[])
How to #define all these three possibilities. And there is not
guarantee that the user is going to use the same names "argc &argv"
all the times. we need also know the argments name if needed to access
them.
I am trying to do this.
#define main(a,b) main(a,b){
my_function();
user_main(argc,argv);
}
user_main(a,b)
But this will not work if we have to deal with above listed 3 cases.
and also the agrument names problem.
Can I have some suggestions on this?
Thanks in advance.