I am trying to create a before-main evaluation like this:
int evaluate(int argc, char** argv) __attribute__ ((constructor));
int evaluate(int argc, char** argv)
{
int result = atoi(argv[1]);
if (result == 0)
return 1;
else
return 0;
}
int main(?????)
{
if (????? == 0)
printf("Wrong number.");
else
printf("It is 1!");
}
Is there a way to do this? I am doing this purely to get myself more familiar with C, passing command line arguments and using pre-main functions.