Hey. Worlds worst programmer here again. I have a question as far as input is concerned. Now, we're supposed to be using the cin to input two numbers on the same line. Piece of cake right? No problem right? Well, with namespace std it is. Unfortunately, I can't do that with this course. I'm supposed to use the string buffer to input the multiple values. My question is, how do I do that? The code I have below compiles, but it just hangs and gives no output. What am I doing wrong? Thanks.
You're inputting the two numbers using the x & y variables. Then you try inputting two more numbers with the buf1 and buf2, then overwrite the first two inputs in x and y. Just use the buf1 and buf2 variables first, and then use the atof() conversions.