C and C++
Moderators: None (
Apply to moderate this forum
)
Number of threads:
28629
Number of posts:
94611
With full replies
Topics only
C and C++
Subforums
Forum Info
This Forum Only
Single Post View
Linear View
Threaded View
f
Normal View
RSS Feed
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
Share By Email
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";
}
}
Share By Email
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
Share By Email
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
Share By Email
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
Share By Email
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";
}
}
Share By Email
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
Share By Email
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";
}
}
Share By Email
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";
}
}
Share By Email
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";
}
}
Share By Email
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
Share By Email
Recent Jobs