Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 DEvc++ problem
Index -> Programming, C++ -> C++ Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
blackcat




PostPosted: Wed Jun 01, 2005 4:51 pm   Post subject: (No subject)

hey how do i use c++ to do commands in dos?
like in my console program lets say.. i wanted to do

netstat -n

or ... display the ip of the person, etc..how can i do it?
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Wed Jun 01, 2005 5:11 pm   Post subject: (No subject)

Use the "system" function. For instance, to insert a pause at the end of their programs, many people will call the DOS "pause" command like so:

c++:
pause("system");


Keep in mind, though, that this is in no way guaranteed to be portable.
1of42




PostPosted: Wed Jun 01, 2005 10:33 pm   Post subject: (No subject)

It's:

c++:
system("pause");
wtd




PostPosted: Wed Jun 01, 2005 10:42 pm   Post subject: (No subject)

Oy... thank you. I've been so distracted lately.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 19 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: