|
| bbbfan (1) | |
| Im pretty new to c++, and am really only using cin and cout so far, but im creating a program for a math class that can quickly multiply matrices together. I have created the whole thing but have one problem. when a user enters the two matrices they have to enter it like this: 3 4 5 6 Is there anyway to set up cin so that I can have users input numbers like this? 3 4 5 6 Where two inputs are found on one line. Any help would be very much appreciated. | |
| screw (113) | |||
| Hello! Here is my probe code:
If cin / >> operator meet with space seperated data then the data will be read separate. Just you should use cin >> a >> b >> c >> d Of course you should check the reading with if (cin.good()){} statement. | |||
Last edited on | |||
Registered users can post in this forum.
