Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
pretty much finished getting my little app to run and have
a question about the system() command.i'm using a command line app called nconvert to process
photos. i use a command similar to this from the command
line:
[code]
nconvert -out outformat -o name_of_processed_file name_of_original_photo
[/code]
there are three variables i use in the command line
scripting i have:outformat
name_of_processed_file
name_of_original_photoi tried this to get system() to execute nconvert but had
a problem with the variables:
[code]
system("nconvert -o outformat -o name_of_processed_file name_of_original_photo")
[/code]
i assume the quotation marks around the nconvert command
are the source of the problem.how do i use system() with variables for the parameters
of the command line app?thanks,
BabaG

got a reply elsewhere suggesting making a big string and using
that within the system() command. just tried it and got an error.
i declared:
[code]
string nconvert_param = "nconvert -out " + outformat + " -o " + name_of_processed_file + " " + name_of_original_photo
[/code]
which i can cout to the screen and prints just as it should.
compiling, however, gives an error about not being able to
convert 'std::string' to 'const char*' for the line in my code:
[code]
system( nconvert_param );
[/code]
tried declaring string nconvert_param' as 'const char nconvert_param'
but that produced a different error.what did i get wrong here?
thanks again,
BabaG

![]() |
C++ Data Validation
|
what is debugger?
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |