ok I'm having an issue with an assignment, we're creating a type of POS program, and when I try to add a book to the inventory, I need to beable to put an entire line into a 2 dimensional array but I'm failing...lol, heres my code...
You did it right several other places, but you screwed up here. Take a close look at your code----don't see what you expect to see, but instead see what's actually there.
You did it right several other places, but you screwed up here. Take a close look at your code----don't see what you expect to see, but instead see what's actually there.
OHH haha, I had the arrows the wrong way... or is that not what your talking about... btw, ya thats not only been fixed... but actually replaced, my teacher told me a way to do it, but to me it just seams that there would a more efficient way of doing it, and in-fact more proper way
1st off she said that I should use "cin.getline" for EVERY input throughout the entire program, then convert when needed, because the only other way is to use cin.ignore()... but to me it seems like more of a hassle to convert half the input... am I wrong?
Mixing getlines with formatted input does require careful use of ignore(), yes, or else some getlines may appear to be skipped (in reality they're just reading the newline ignored by the formatted input before them).
Another problem with formatted input is that if the user enters something unexpected, say "a" when you ask for an int, it puts the stream into a fail state and you have to handle that carefully.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.