please can anyone tell me whether i can use command line arguments in c on windows xp
if so how
please can anyone tell me whether i can use command line arguments in c on windows xp
if so how
you just posted a thread on this.... don't post the same thread twice!
the answer is YES.
how:
start>run>"cmd"
then...
cd c:\path\to\file\
then...
bla.exe ARG1 ARG2
--------------------------
bla.exe would be from your bla.c which would have
int main(argc, *argv[])
argc <-- number of arguments
argv <-- the arguments
process accordingly...
http://publications.gbdirect.co.uk/c...s_to_main.html
http://www.d.umn.edu/~gshute/C/argv.html
Last edited by simpleid; 08-15-2007 at 08:05 AM.
Same as here - http://cboard.cprogramming.com/showthread.php?t=92661
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.