Passing Command line arguments to int main(int argc, char *argv[])

Passing Command line arguments to int main(int argc, char *argv[])

Post by hebetud » Sun, 23 Oct 2005 16:36:14


I use .NET and have found the famed Command Arguments tab, but it does
not pass just standard arguments. I'm trying to pass two simple
arguments:
fcfs filename.txt

yet it gives me two errors without even attempting to use the argument
variables:

c:\Documents and Settings\Drew\My Documents\My
Programs\Heap\students.txt error C2059: syntax error : 'constant'
Heap fatal error C1083: Cannot open source file: 'fcfs': No such file
or directory

Every other time it runs correctly, but passes the filename of the
program first and fcfs as argv[1] filename.txt as argv[2].

As of right now I'm thinking g++ > .NET