473,656 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

system() function usage

Hello Guys,
I have a doubt in system() function. I need to implement
the certain command line arguements in a program.
For Example

if I type "dnaml" at command line and press enter then it will ask me
to enter 'Y' and if I press enter it will generate some files.
So here I used

system("dnaml")

function and I am confused how to provide 'Y' without typing in
command line.
Any help will greatly be appreciated.

Thank You
Nandini

Apr 20 '06 #1
2 2413
nnandi...@gmail .com wrote:
Hello Guys,
I have a doubt in system() function. I need to implement
the certain command line arguements in a program.
For Example

if I type "dnaml" at command line and press enter then it will ask me
to enter 'Y' and if I press enter it will generate some files.
So here I used

system("dnaml")

function and I am confused how to provide 'Y' without typing in
command line.
Any help will greatly be appreciated.

Thank You
Nandini


The answer to your question is OS-specific, and so you should take the
question to a newsgroup for your OS. See this FAQ for some ideas of
where to post:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

<OT>It will probably look something like: system( "echo y | dnaml" )
unless there are some command line switches you can append to your
command line to produce the same behavior.</OT>

Cheers! --M

Apr 20 '06 #2
nn*******@gmail .com wrote:
So here I used

system("dnaml")

functionÂ*Â*and Â*IÂ*amÂ*confus edÂ*howÂ*toÂ*pr ovideÂ*'Y'Â*wit houtÂ*typingÂ*i n
command line.


None of the answers are on-topic for this newsgroup. They are: Either use a
variant of popen() that redirects a "y" in, or use system("dnaml <
yes.txt");

You will get the best answer by Googling for a forum that discusses either
your compiler's libraries or your command line syntax for your platform.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

41
10018
by: Alexei A. Frounze | last post by:
Seems like, to make sure that a pointer doesn't point to an object/function, NULL (or simply 0) is good enough for both kind of pointers, data pointers and function pointers as per 6.3.2.3: 3 An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.55) If a null pointer constant is converted to a pointer type, the resulting pointer, called a null pointer, is guaranteed...
2
4156
by: Richard | last post by:
How can we change/reset the system date. Thanks in advance. RC
4
3421
by: Hermann Maier | last post by:
hi, i need to find out the memory usage of a specific function that i use in my program. this function does some recursive calculations and i want my program to display the amount of memory the function used to calculate a specific value. thx
0
1074
by: Ankur Goel | last post by:
When I'm running my ASP.NET application, system throws the following exception. Although page is displayed properly but this exception is thrown internally. And also when I'm doing load testing for this page by using ACT with the scenario of 50 users, I find that CPU usage is 100%. (w3wp.exe takes 100% CPU usage.) Please help me. Error Exception ::
28
4305
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
2
2383
by: miguel | last post by:
Hi, I have created a service which parses real-time prices from one format into another. This is all working very quickly and nicely, however, I have recently found that the memory usage is astronomical after a few hours. (1.5-2 Gig) After a good amount of digging I found that the memory usage is is all in System.String and contained within the pricing object. This object makes extensive use of a single string object which is...
41
381
by: Baron Samedi | last post by:
I want to produce a piece of software for embedded systems, generally telecoms based, mostly running on ARM processors, but I can't guarantee that, of course. My software should work along with other software which will generally be written in C or C++ (occasionally in ADA or even assembler). I suppose that there are C compilers for marginally more processors than C++, but, realistically, I am not sure that it makes a major difference.
2
1151
by: Anish Chapagain | last post by:
Hi, I have Structure in C, program and the structure is being used with various function inside C coding but am getting undefined referenced to global method and few of them too uses the sturct module. my problem goes like this, ex.h ----------- #define NIL 0 /* Indicates ptr is nil */ #define NO_CODER 0 /* Means do not use an arithmetic
30
3152
by: Yorian | last post by:
Hey, Although I've been using classes and object for quite a while now I've never actually programmed proper OO code yet. It ofcourse depends on what you call proper OO code. I have been seperating parts of the website. Like a user class, guestbook class, etc. But I've been putting all the code in one single class instead of of spreiding it. Since a short while I've been reading up on OOP and now I am trying to actually do things the...
0
8297
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8498
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.