C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28645
Number of posts: 94661

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How do I create terminal commands in a c++ program? Posted by Hi-TechITO1 on 24 Dec 2012 at 7:49 PM
I'm writing a c++ program and I want people to be able to operate it from the terminal. The only thing I know how to do is cin which, though upon receiving the program could act, I wouldn't call a command. Thanks!!

ASP.Net Development
Report
Re: How do I create terminal commands in a c++ program? Posted by aonline65 on 10 Jan 2013 at 5:12 AM
You can try this :-

#include <iostream>
int main(int argc, char* argv[])
{
std::cout << "Command: " << argv[0] << "\n";
for(int loop = 1;loop < argc; ++loop)
{
std::cout << "Arg: " << loop << ": " << argv[loop] << "\n";
}
}
Report
Re: How do I create terminal commands in a c++ program? Posted by emreatan on 10 Jan 2013 at 8:20 PM
thanks for your help
Report
Re: How do I create terminal commands in a c++ program? Posted by emreatan on 10 Jan 2013 at 8:22 PM
thanks for your help
Report
Re: How do I create terminal commands in a c++ program? Posted by emreatan on 10 Jan 2013 at 8:23 PM
thanks for your help
Report
Re: How do I create terminal commands in a c++ program? Posted by aonline65 on 10 Jan 2013 at 5:14 AM
You can try this :-

#include <iostream>
int main(int argc, char* argv[])
{
std::cout << "Command: " << argv[0] << "\n";
for(int loop = 1;loop < argc; ++loop)
{
std::cout << "Arg: " << loop << ": " << argv[loop] << "\n";
}
}
Report
Re: How do I create terminal commands in a c++ program? Posted by Hi-TechITO1 on 11 Jan 2013 at 7:04 PM
Thank to Giving Feedback

ASP.Net Development
ASP.Net Web Development
Report
Re: How do I create terminal commands in a c++ program? Posted by JimmyAdams on 16 Jan 2013 at 1:15 AM
Try this would help you

#include <iostream>
int main(int argc, char* argv[])
{
std::cout << "Command: " << argv[0] << "\n";
for(int loop = 1;loop < argc; ++loop)
{
std::cout << "Arg: " << loop << ": " << argv[loop] << "\n";
}
}
Report
Re: How do I create terminal commands in a c++ program? Posted by JimmyAdams on 16 Jan 2013 at 1:17 AM
Try this would help you

#include <iostream>
int main(int argc, char* argv[])
{
std::cout << "Command: " << argv[0] << "\n";
for(int loop = 1;loop < argc; ++loop)
{
std::cout << "Arg: " << loop << ": " << argv[loop] << "\n";
}
}
Report
Re: How do I create terminal commands in a c++ program? Posted by JimmyAdams on 16 Jan 2013 at 1:25 AM
Try this would help you

#include <iostream>
int main(int argc, char* argv[])
{
std::cout << "Command: " << argv[0] << "\n";
for(int loop = 1;loop < argc; ++loop)
{
std::cout << "Arg: " << loop << ": " << argv[loop] << "\n";
}
}
Report
Re: How do I create terminal commands in a c++ program? Posted by Hi-TechITO1 on 17 Jan 2013 at 7:10 PM
Thank to All Of you for Suggest your opinion.

.Net Development
ASP.Net Web Development



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.