Hello, To Improve my C++ skills (and some boredom), I've decided to create my mini programming language. It will read a string from a file and react as the context of the string. Here
is my question
- How to read a string in specific characters and give an error if they are missing. e.g:
1 2 3 4 5 6 7 8 9
if(readed_string == "print")
{
// here how to check if there are () or not.
if(have_())
{
// how to read text within "" ?
}
}
#include <iostream>
usingnamespace std;
int main() {
string a = "lost (of) stuff";
for (auto i : a) {
if (i == '(' || i == ')')
continue;
cout << i << endl;
}
system("pause");
}