tomadom's Profile
Reputation: 1
Apprentice
- Group:
- Members
- Active Posts:
- 26 (0.16 per day)
- Joined:
- 11-December 12
- Profile Views:
- 456
- Last Active:
Apr 12 2013 09:14 AM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Calling an exe file with System() and passing arguments?
Posted 25 Feb 2013
no2pencil, on 25 February 2013 - 07:06 AM, said:
tomadom, on 25 February 2013 - 05:21 AM, said:It really doesn't matter why I'm passing and returning a string, it's the concept I'm trying to understand.
In my book it does matter, because C/C++ may not be the best language for the situation. Myself, I would use the shell unless absolutely necessary, because system is going to return true, pretty much always. It does not return the shell output. You need to capture it another way, & that's a lot of run-around when you can do it right at the shell & pipe, or redirect it's output.
You very well may be getting the output, after all we have no code to go on to help you further troubleshoot the issue. The situation maybe that you are not getting the output you expect, so you think it isn't working.
I didn't give you any more than I did because I wanted a specific answer.
I'm not looking for the simplest solution either.
I only have C++ in this case thats it..
I'm not troubleshooting. I'm asking a direct question.
Skydiver answered it in one so I'm not sure what the issue is. -
In Topic: Calling an exe file with System() and passing arguments?
Posted 25 Feb 2013
Thank you Skydiver.
That gives me something to look up.
I'll certainly look at what you have suggested. -
In Topic: Calling an exe file with System() and passing arguments?
Posted 25 Feb 2013
Lets say for example, I input a string into Foo.exe and it outputs that string backwards.
It's a useless program but I just want to know how to pass an argument when calling a executable binary.
No alternatives -
In Topic: Calling an exe file with System() and passing arguments?
Posted 25 Feb 2013
no2pencil, on 24 February 2013 - 11:51 PM, said:This isn't advanced C/C++ discussion, moving to C/C++.
Why are you setting a variable to a string value, & then just passing that string verbatim anyway?
As for your question, the first thing thing I would ask is the path to 'foo.exe' correct? How have you determined it is the argument that isn't being passed & not the system call to the exe that is failing?
Thanks for moving the post. I pondered where to put it for a while.
It really doesn't matter why I'm passing and returning a string, it's the concept I'm trying to understand. The path to
foo.exe is correct in the examples I tried and I did use the path. So it was an error on my behalf not displaying the path to foo.exe.
Let me generalize the question.
Do you know how to pass arguments using system()?
For example:
//is it system("c:\\Documents\\foo.exe argument");
if it is then I may have something wrong with my code but I'm having trouble having foo.exe respond with
anything but a garbage value. -
In Topic: The Term 'Expansion'?
Posted 1 Jan 2013
Thanks, that explain it well.
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Private
Friends
tomadom hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
tomadom has no profile comments yet. Why not say hello?