 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Claudio Varini Guest
|
Posted: Thu Oct 28, 2004 8:03 am Post subject: use of argc and argv |
|
|
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
--
Claudio Varini
Büro: E5-113
Tel. +49 521 106 6197
|
|
| Back to top |
|
 |
Nicolas Pavlidis Guest
|
Posted: Thu Oct 28, 2004 8:56 am Post subject: Re: use of argc and argv |
|
|
Claudio Varini wrote:
| Quote: | 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
| Quote: | 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
|
|
| Back to top |
|
 |
Rolf Magnus Guest
|
Posted: Thu Oct 28, 2004 11:44 am Post subject: Re: use of argc and argv |
|
|
Claudio Varini wrote:
| Quote: | Hallo,
is the use of argc and argv to pass input parameters "object oriented"?
|
What exactly do you mean by "obhect oriented"?
| Quote: | 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?
|
|
| Back to top |
|
 |
Howard Guest
|
Posted: Thu Oct 28, 2004 2:52 pm Post subject: Re: use of argc and argv |
|
|
"Claudio Varini" <varini (AT) physik (DOT) uni-bielefeld.de> wrote
| Quote: | 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
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|