Thanks again for all the help, the code you gave me does work, only i now have to get it to work this way.
Code:
void CheckArgs(int iNumberOfArgs, char* iArguments[])
{
printf(&iArguments[0]);
printf(&iArguments[1]);
printf(&iArguments[2]);
MyCopyFile(iArguments[1], iArguments[2]);
}
int main(int iNumberOfArgs, char* iArguments[])
{
srand(time(NULL));
rand();
if (iNumberOfArgs > 4 || iNumberOfArgs < 2)
{
printf("USAGE: [[/C] | [/D]] INPUTFILE [OUTPUTFILE]\n");
}
else
{
if (iNumberOfArgs == 2) CheckArgs(1,iArguments[1]);
if (iNumberOfArgs == 3) CheckArgs(2, (iArguments[1], " ", iArguments[2]));
if (iNumberOfArgs == 4)
{
CheckArgs(3, iArguments[1], " ", iArguments[2], " ", iArguments[3]);
}
}
return 0;
}
The other problem is that the printf() returns the right hand sides of the arguments. the first argument it in full, the second is missing a letter on the left and the third is missing two letters on left.
any ideas??
thanks,
Shaun
The problem i'm having is that by that point, it is pointing to a memory locaiton with a reference to a memory location in it.