anatazi, possibly you could refer to this for command line stuff:
Code:
/*
Program:
CmdLine.c
Purpose:
Demonstrates the use of command line parameters.
*/
#include <stdio.h>
void default_message(void);
int main( int argc, char * argv[] )
{
if (argc == 2)
{
if(argv[1][0] == '?')
{
printf("Help stuff would go here.\n");
}
else
{
printf("%s \n", argv[1]);
}
}
else if ( argc >= 3 )
{
printf("Invalid input:\n");
printf("Only one command-line parameter allowed.\n");
}
else
{
default_message();
}
return 0;
}
void default_message(void)
{
printf("CmdLine.exe:\n");
printf("The purpose of this program is to demonstrate command line arguments.\n");
printf("This program will print whatever you type on the screen.\n\n");
printf("Example:\n");
printf("C:\\>CmdLine.exe Hmmm\n");
printf("Hmmm\n");
}
This just demonstrates command line arguments, i'll leave the age stuff to you.