LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-04-2007, 12:22 AM   #1
babag
Member
 
Registered: Aug 2003
Posts: 419

Rep: Reputation: 31
c/c++ embarassingly noob question


i've done some scripting and am used to using scripts to call apps to
have them perform some task they're designed to perform. is this ever
done in actual programming, or would one have to get an sdk and use
the app's libraries directly?

thanks,
BabaG
 
Old 10-04-2007, 01:20 AM   #2
fcdev
Member
 
Registered: Sep 2005
Posts: 47

Rep: Reputation: 15
Some things you can do by launching another application, other things you would do through an SDK. It comes down to speed, the difficulty of writing the functionality yourself, and availability of services from other programs. Typically, bringing up another application might take few seconds. Would that be a problem when displaying a readme file? No. Is it worth the time and effort of developing your own text-viewer tool just to save those two seconds at run-time? Most likely not.

However, there are other cases where those delays can be catastrophic. For example, if you are playing a fast-action video game, and because the background music has finished, you wish to start playing another piece of music ... a 2 second pause in the action would be undesirable. In this case, you would be better off tracking down a library that you can link to (in other words, an SDK), that will play the music for you.

Using a library, or writing up the code itself can usually result in faster response times, but it does lead to more work. It's best to decide on a case-by-case basis.
 
Old 10-04-2007, 06:50 PM   #3
babag
Member
 
Registered: Aug 2003
Posts: 419

Original Poster
Rep: Reputation: 31
thanks fcdev. what's the c/c++ syntax to call another app?
i'm currently using this kind of thing in bash to call a
cli app for foto processing:

path/to/app -option optionvalue /path/to/save /path/to/file

would i just replicate that in a c++ app, or is there more
to it? links or any other help much appreciated.

thanks again,
BabaG
 
Old 10-04-2007, 07:00 PM   #4
rsashok
Member
 
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202

Rep: Reputation: 31
Look at function and usage examples ofq:
system()

If you want to become more sophisticated and educated on the subject, look up on the Web about fork() and execv() family of functions. But be aware it is rather advanced Linux programming.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Another noob question deepblue_diver Fedora 6 12-22-2006 12:29 PM
noob with a noob question phoonerorlater Linux - Newbie 2 09-29-2004 03:43 PM
Another noob question Zerokule Slackware 6 09-20-2004 03:39 PM
editing config files.. embarassingly basic question adhara Linux - Newbie 3 12-23-2003 07:27 AM
Complete noob question from a noob noob_hampster Linux - Software 2 09-04-2003 12:03 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration