Hi again,
I am working on a small project which sort of resembles a makeshift programming language, in which if the user types "print" and then a value, the console will write the value, and not the string, for example, if I write Print "Hello", it will output the string "hello". It is sort of like a makeshift language that I want touse to teach the basics of programming, here is my code:
#include <iostream> using namespace std; int main (void) { string firstword, secondword; cout<<"Input: "; firstword = cin.get(); cin.ignore(1,' '); secondword = cin.get(); if (firstword == "print") { secondword = firstword + secondword; cout << secondword; } return 0; }
Thankyou!