473,406 Members | 2,377 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,406 software developers and data experts.

How to map command line args into an integer array

Hi Guys,

by using command line arg im geting 4 args.

Eg. 3 4 5 6

hw cud i put those in an integer array eg. a[4].
output
a[0]=3,a[1]=4,a[2]=5,a[3]=6

help me with it
Sep 12 '07 #1
1 1681
sicarie
4,677 Expert Mod 4TB
Hi Guys,

by using command line arg im geting 4 args.

Eg. 3 4 5 6

hw cud i put those in an integer array eg. a[4].
output
a[0]=3,a[1]=4,a[2]=5,a[3]=6

help me with it
As they are already in the argv array, you could try to move them over to an int array (I'm not sure if they're read in as strings or ints, but if they're not, you can use atoi() to convert them.
Sep 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
8
by: djc | last post by:
I'm new to this and was wondering what the options are for interpreting the command line using a CLI program. Specifically methods for interpreting the parameters passed to the program on the...
10
by: David B | last post by:
I am writing a console App with VB 2005 where I accept a text file as input, parse it and insert the text data into an SQL table. I have written the code correctly as well as I can tell because it...
2
by: explode | last post by:
I made nova oledbdataadapter select update insert and delete command and connection veza. dataset is Studenti1data, I made it by the new data source wizard,and made datagridview and bindingsource...
6
by: virgincita schmidtmann | last post by:
Good evening, I would like to pass the size of an array from the commandline. int main(int argc, int *argv) { .... max=*argv; int list; ....
3
by: imtiazalikhan | last post by:
hi i am trying to passing arthematic expressions through command line arguments but i only get result of addition and multiplication cant get result of subtraction and division: ...
4
by: lilyumestar | last post by:
I have project I have to do for class. We have to write 4 different .java files. Project2.java HouseGUI.java House.java HouseSorting.java I already finish House.java and I need to work on...
6
by: Phil Hellmuth | last post by:
I'm fairly new to VS/VB.net. I want to create a command line utility that uses two parameters, reads a file (first parm), and writes to another file (2nd parm). Which VS/VB.net template should I...
2
by: =?Utf-8?B?S2VsdmluIEpvaG5zb24=?= | last post by:
I am wrapping a legacy C api using C++\CLI. I will use the resulting classes from C# and VB.net. I need to pass command line arguments from the .net languages to the c api functions, so I've...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.