is it possible to use c++ similar to command prompt? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

is it possible to use c++ similar to command prompt?

i am not sure whether my question is right or wrong. if right pls tell me the way

22nd Jul 2016, 12:39 PM
raju
raju - avatar
6 Answers
+ 3
c++ is a programming language and the command prompt is like a window into your operating system, you can use c++ to send commands through the command prompt however.
22nd Jul 2016, 12:52 PM
Null Void
Null Void - avatar
+ 1
it is yes
22nd Jul 2016, 1:20 PM
Null Void
Null Void - avatar
0
thanx bro
22nd Jul 2016, 1:07 PM
raju
raju - avatar
0
is it possible to use batch script command in linux
22nd Jul 2016, 1:08 PM
raju
raju - avatar
0
AFAIK, system(command) will do that regardless of the OS
23rd Jul 2016, 12:58 AM
_Geometry dash_ _Roh_ (AKA NovaRate0315)
_Geometry dash_ _Roh_ (AKA NovaRate0315) - avatar
0
#include <iostream> #include <string> #include <Windows.h> // or <unistd.h> if *nix using namespace std; int main() { while(1) { string R; getline(cin,R); system(R.c_str()); //remember system() is unsafe } return 0; } ^ example
23rd Jul 2016, 1:02 AM
_Geometry dash_ _Roh_ (AKA NovaRate0315)
_Geometry dash_ _Roh_ (AKA NovaRate0315) - avatar