[B]
Code:
#include <iostream>
#include <vector>
#include <string>
#include <conio.h>
void Prompt()
{
std::string s;
//std::cin>>s;
getline(cin, s); // change here
std::string command;
std::string arg;
std::cout<<"PROMPT1";
std::vector<std::string> vec;
std::cout<<"PROMPT2";
int start = 0, end = 0;
std::cout<<"PROMPT3";
while ( end != std::string::npos )
{
end = s.find ( ' ', start );
std::cout<<"PROMPT4";
vec.push_back ( s.substr ( start, end - start ) );
std::cout<<"PROMPT5";
start = end + 1;
}
std::cout<<"PROMPT6";
command = vec[0];
arg = vec[1];
std::cout<<"PROMPT7";
std::cout<<command<<arg;
if(command=="cls")
{
//clrscr();
}
else
{
std::cout<<"ERROR";
}
}
int main()
{
Prompt();
}
I made one change at the start of your code, try it now