I've got this string:
I want to get an integer value = 4 from this. How would I go about doing this.Code:char * string = "2+2";
Thanks
I've got this string:
I want to get an integer value = 4 from this. How would I go about doing this.Code:char * string = "2+2";
Thanks
You will have to parse the string. Anytime you come across an character that is an int, add it to a string. Then you can use atoi() function to convert it to an integer. That should get you started. You will have to think about how you account for operators. If you get stuck come back here.