ACTUAL TITLE: CAN'T ASSIGN IN VALUE TO ARRAY OF INTS....sorry, I was issuing weapons while writing this and got distracted....
Ok...this is really irritating me...I've been putting a DOS based...
Type: Posts; User: motarded
ACTUAL TITLE: CAN'T ASSIGN IN VALUE TO ARRAY OF INTS....sorry, I was issuing weapons while writing this and got distracted....
Ok...this is really irritating me...I've been putting a DOS based...
Hmm...I guess I could store them as a bidimensional array of strings....hmmmmmmmm
Here's what I have right now:
void Player::GetWord()
{
srand( (time(NULL) );
int NumLines(0), RandNum, length;
ifstream File;
char * buffer;
Ok...I wrote it all down and it made a little more sense...
I read it all into a buffer, then go through and see how many '\n' characters there are. But how can I declare the positions after the...
I'm trying to select a value at random from a .txt document. Each value is on a separate line (I understand that the computer interprets that as Value 1\nValue 2\n Value3).
Example.txt
...
MFC = ?
On the topic of learning about GUI's....does anyone have a link to a good tutorial? Unfortunately, the book option isn't an option in Africa. I'm not looking for a 24 hour fix or...
SM,
I compile and run the code that Daved posted, and if I enter "4 ajfie" it still reads as invalid input. The only way it will accept the input is if it is a float, and only a float...
Ok....this code
#include <iostream>
#include <limits>
using namespace std;
int main()
Daved, thanks a lot. That code works well. I understand this part:
while(!(cin >> f1))
This means that if the input is not a float number, the while loop will continue to loop.
But...
Are there any restrictions on your assignment; as far as what you HAVE to have included? Or do you just need to write code to convert 5, 6, 7, 8, 9 to 5, 6, 7, 7, 7?
Maelstrom, I tried that, but if the users inputs a number in the beginning, followed by incorrect characters, then rather than giving an error message, the program just assumes that is the number...
That only applies to strings. Originally, I was just using a float variable. The problem with having the user input a string is that I can't add them to each other. So Verify.cpp takes the string...
How would I go about clearing the state of the stream?
I'm relatively new to programming and I'm having a little bit of trouble. I'm putting together a calculator program that adds, subtracts, whatever. When the addition function is called, it prompts...