C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

use of argc and argv

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Claudio Varini
Guest





PostPosted: Thu Oct 28, 2004 8:03 am    Post subject: use of argc and argv Reply with 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)?

Thanks

--
Claudio Varini
Büro: E5-113
Tel. +49 521 106 6197
Back to top
Nicolas Pavlidis
Guest





PostPosted: Thu Oct 28, 2004 8:56 am    Post subject: Re: use of argc and argv Reply with quote



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





PostPosted: Thu Oct 28, 2004 11:44 am    Post subject: Re: use of argc and argv Reply with quote



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





PostPosted: Thu Oct 28, 2004 2:52 pm    Post subject: Re: use of argc and argv Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.