Receiving and splitting input from user

Hello,
I am writing a code that will take in a string input from a user that will be read by my compiler to do as the string says. (ex. to create a rectangle, the user will input "build Rectangle 4 5" where 4 and 5 stand for height and width respectively). I want to know how I can use getline and then split the string input to call on the correct function for my specific class Rectangle(I am implementing inheritance with a Shape parent class and my derived class is Rectangle.) Thank you for any input that can help me reach my goal. Below is some code of what I am trying to do.

1
2
3
4
5
6

	int main() {
		string input;
		cout << "Options: build, print.";//user input "build Rectangle 4 5"
		getline(cin, input);
	}
Topic archived. No new replies allowed.