Subject: c++ compiler command line argument passing
To: None <tech-toolchain@netbsd.org>
From: Joseph Sarkes <joe@js1.jsnet>
List: tech-toolchain
Date: 08/07/2000 21:58:51
I am trying to compile the following simple c++ program
called t.cc:

#include <iostream> 
int main (int argc, char* argv[])
{
int i;
cout << "hello world\n";
cout << argc << "\n";
for(i = 0, i < argc, i++) cout << argv[i];
}

When I try to compile the above program, I get:

c++ -O2   -o t t.cc 
t.cc: In function `int main(int, char **)':
t.cc:8: syntax error before `)'
*** Error code 1

Stop.


What is wrong with the argument list accessing method I am using?
It is the same as I am familiar with in C and also what the 
Stroustrop C++ book spells out.  Is this MY error, or the C++ 
compiler toolchain?

-- 
Joseph Sarkes		jsarkes@tiac.net