I have had this happen before, sometimes when I have still had the program open from previous debugging, as others have said. I have also had this happen randomly and after recompiling it again it...
Type: Posts; User: redsfan
I have had this happen before, sometimes when I have still had the program open from previous debugging, as others have said. I have also had this happen randomly and after recompiling it again it...
I have now changed my code to use a vector instead of an array and everything is working ok, but I have an issue with one of the vector's.
I have had to declare the vector "code" globally to get...
I did not know about the min and max functions, but now I do. That all makes sense, thanks to both of you.
One other question. In the code you posted, you declare the std namespace before vector, is there an advantage to doing this over putting using namespace std in the declarations.
Ok, thanks.
Thanks, I am going to look into vector's. I have just been reading about bounds checking, from what I understand there are 2 types, index checking, range checking.
Now I get index checking, making...
I knew someone would mention using a vector, I am going to do some reading on them and as long as it doesn't mean altering the structure of my program too much, I will probably implement them. What...
I found some code for allocating and deallocating a dynamic 2d array, I modified it for my program and everything seems to work as it should. However I saw a comment saying this code could cause some...
Aah that does it, thanks.
I am trying to write my array to a file but I have a slight problem. The code below writes the array to the file but it also writes a new line after each element is written and I want the whole array...
yep, that makes sense, cheers
Thanks, that explains some strange behavior I was getting, when inputting more than 10 strings for case 4:
what is the best way to stop a user adding more strings than I want, if statement?
...
Why can I seem to use outside the Arrays limit [10][10]? For instance if I use the following code, it assigns and outputs the arrays element.
code[1][50] = "outside array";
cout << code[1][50];...
Sorry I didn't know there was a link in there, I was wondering what page you were reffering too:rolleyes: So I went of looking when you told me what the problem was and fflush(stdin)
was the first...
Ahh I see, that works fine, thanks.
Thanks mk27 that explains it and it was fixed by putting in fflush(stdin); :)
Could you tell me what you are doing in this following line?
int main(int argc, char *argv[])
It looks like...
Hello,
I am just starting out in learning C and I want to make a simple program that creates a string, from the options a user inputs and then sorts that string into a correct format for display....