use of argc and argv

C

Claudio Varini

Hallo,
is the use of argc and argv to pass input parameters "object oriented"?

Or in C++ is better to use other approaches (es the command cin)?

Thanks
 
N

Nicolas Pavlidis

Claudio said:
Hallo,
is the use of argc and argv to pass input parameters "object oriented"?

There is AFAIK no other way to pass parameters to a program. What you
can do is to wirte a OO CommandlineHander, which takes these parameters
Or in C++ is better to use other approaches (es the command cin)?

This will not work, becaue, it can only read such params while the
program is running, not when it starts.

HTH && Kind regards,
Nicolas
 
R

Rolf Magnus

Claudio said:
Hallo,
is the use of argc and argv to pass input parameters "object oriented"?

What exactly do you mean by "obhect oriented"?
Or in C++ is better to use other approaches (es the command cin)?

I don't know what you're talking about. What has cin to do with argc and
argv?
 
H

Howard

Claudio Varini said:
Hallo,
is the use of argc and argv to pass input parameters "object oriented"?

Or in C++ is better to use other approaches (es the command cin)?

Those command line parameters are simply a count of the number of parameters
and an array of that many character arrays. You simply treat them as
variables. They're not objects, and they also can't be "read" using cin.
When main() executes, they're passed in as parameters to that function, just
like parameters to any other function. What is it you are trying to do?
(You should be able to find many examples of using those if you search the
web. Try groups.google.com.)

-Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top