473,387 Members | 1,553 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,387 software developers and data experts.

Trouble with excelp() (I'm very new to this)

5
I'm using C and attempting to pass something like this:

Expand|Select|Wrap|Line Numbers
  1. ret = execlp( "somefile", "somefile", num1, num2, (char *)0 );
Of course, that doesn't work.

This, on the other hand, works fine:

Expand|Select|Wrap|Line Numbers
  1. ret = execlp( "somefile", "somefile", argv[1], argv[2], (char *)0 );
That'd be great, but I can't just pass argv to it. Before it gets there I have to convert them to ints, do a little work on them, then pass them. How do I do this?? If I convert them back to char they don't pass correctly.

Say, somefile simply says

Expand|Select|Wrap|Line Numbers
  1. cout << argv[1] << endl;
If I'm lucky it'll print some random number, that I'm assuming is what's in some random address space.

Any help is greatly appreciated!!
Feb 10 '08 #1
2 3083
ashitpro
542 Expert 512MB
I'm using C and attempting to pass something like this:

Expand|Select|Wrap|Line Numbers
  1. ret = execlp( "somefile", "somefile", num1, num2, (char *)0 );
Of course, that doesn't work.

This, on the other hand, works fine:

Expand|Select|Wrap|Line Numbers
  1. ret = execlp( "somefile", "somefile", argv[1], argv[2], (char *)0 );
That'd be great, but I can't just pass argv to it. Before it gets there I have to convert them to ints, do a little work on them, then pass them. How do I do this?? If I convert them back to char they don't pass correctly.

Say, somefile simply says

Expand|Select|Wrap|Line Numbers
  1. cout << argv[1] << endl;
If I'm lucky it'll print some random number, that I'm assuming is what's in some random address space.

Any help is greatly appreciated!!
Convert num1 and num2 to char * i.e. make them into string
Feb 11 '08 #2
jazon
5
Convert num1 and num2 to char * i.e. make them into string

Thanks a bunch! Works perfectly with sprintf!
Feb 11 '08 #3

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

Similar topics

2
by: James | last post by:
Hi I am having some trouble getting a asp page to load. Im a noob to the asp side. I have followed knowledege base Article 301305. I am running 2000 adv, IIS 5.0 I have the following...
0
by: Alexandre Jaquet | last post by:
Hi does anybody know how to solve my trouble, when I try to create a MS Office project I always got trouble. I can't create office project when I try to create one vs.net restart ... :s
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
0
by: cwbp17 | last post by:
I'm having trouble updating individual datagrid cells. Have two tables car_master (columns include Car_ID, YEAR,VEHICLE) and car_detail (columns include Car_ID,PRICE,MILEAGE,and BODY);both tables...
0
by: R. Tschirley | last post by:
Hi all, I've got some annoying trouble with IE's display of my new website header. On my site, the corporate logo shall be right-aligned: ...
1
by: rh1200la | last post by:
Hi there. I'm having trouble with an HTTP Post in my code behind. Can anyone help? Here's my code: string data = "&fields_fname = " + txtFirstName.Text + "&fields_lname=" +...
2
by: JLupear | last post by:
I am having trouble with my code again, I had prepared a question and the code to upload, however I am having trouble posting it, are there limits to the amount of lines you can post? I split it...
2
by: roger26 | last post by:
I am having trouble with a registration page. Which contains 3 groups of radio buttons and a check box i having hard time to making it work. I have added code for matching the password too but having...
0
by: mrchatgroup | last post by:
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.