473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Jul 22 '05 #1
3 6137
Claudio Varini wrote:
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
Jul 22 '05 #2
Claudio Varini wrote:
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?

Jul 22 '05 #3

"Claudio Varini" <va****@physik.uni-bielefeld.de> wrote in message
news:41***************@physik.uni-bielefeld.de...
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

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: mg | last post by:
Hello, I am writting bindings for a FEM application. In one of my function 'initModulename', called when the module is imported, I would like to get the argc and argv arguments used in the main...
9
by: Vinu | last post by:
Hai when i compile the cpp file(cmdargs.cpp) i attached the output below the program int main(int argc, wchar_t* argv) { std::wcout<<L"Name of the Program is "<<*argv<<std::endl;...
19
by: hpy_awad | last post by:
What should I do to avoid the message : parameter 'argc' is never used My program is down : *-------------------- /* Book name : The prodessional programmers guide to C File name ...
29
by: Merrill & Michele | last post by:
I'm now looking at page 115 K&R. After having discussed counterexamples, I shall herewith and henceforth make all my c programs look like int main(int orange, char* apple) {return(0);} Q1) ...
13
by: Sokar | last post by:
I have my main function set up as int main(int argv, char *argv) so taht i can read in a variable which is passed to the program on the command line. The problem is that main calls other...
4
by: Xog Blog | last post by:
Hi I am by some people's standards a newbie to C, and I am refreshing my memory as to some of its conventions. I would like any patient soul out there to help out. I am having a horrible time...
7
by: =?Utf-8?B?Vmlu?= | last post by:
Hi, I have a question. I created a simple executable program using Visual C++ from Visual Studio 6.0 This program is called from a script that passes in one argument. Now, my question is: ...
4
by: interec | last post by:
Hi Folks, I am writing a c++ program on redhat linux using main(int argc, wchar_t *argv). $LANG on console is set to "en_US.UTF-8". g++ compiler version is 3.4.6. Q1. what is the encoding of...
11
by: vicky | last post by:
hi all, please tell me with example, how the *argv point to the the no of strings.
4
by: Romulo Carneiro | last post by:
Hi, I'm programming in Windows XP and i'm trying to get all arguments of some application, but i only have gotten five argv. When i put more then five(5), it didn't display. =>Input Command Line:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.