User Profile
Collapse
-
whodgson, Banfa, and JosAH are all correct. You can't try to open that garbage - you have no idea what bogus values are in the memory location until you set it yourself. Better get a filename in there, or at least make sure it's null-terminated by the 64th character. -
setText takes a String argument, and requires a String. An int, double, char, etc. won't work. By adding the + "", you are performing string concatenation. Java automatically treats your number (int, double, whatever) as a String (by using its .toString() method or some equivalent), then appends it with the empty string "".
It's one of those weird things that you just have to get used to.Leave a comment:
-
-
Since you've commented out the faulty line scores[index++] = aScore, index is no longer getting updated, so your final loop will not work anymore. Try getting scores.size() into a variable and looping based on that instead of index.Leave a comment:
-
seed is not a random function. It is not a random number. seed is an int that you told to be the value of time(0).
To get random numbers, use the rand() function.Leave a comment:
-
happyse27,
Just to reiterate what KevinADC said, I don't think you've done anything to warrant any sort of 'posting ban'. It was likely an error due to our changing interface. Please try again.Leave a comment:
-
It really depends on several things. When I am using a command line compiler like g++, I don't need the system("pause") command at the end, since I can just view the output in the command prompt after the program runs. When I use the IDE Dev C++, I need to use that line, because otherwise the window disappears (I've been told running in the non-Debugging mode fixes this, but I've done it in non-Debug mode, and it still doesn't work)....Leave a comment:
-
boxfish is right. In a 2D array, you have to use 2 for...loops to access the array (well, as long as you access it as a 2D array...weaknes sforcats has a great article about this type of nuance in the insights section called Arrays Revealed), so it is expected that you should need 2 for...loops to access every element in a (simulated) 2D vector.Leave a comment:
-
-
It may be that you installed Tk incorrectly (not sure if it came with your installation).Leave a comment:
-
In addition, the shell of code you were given does not define an iterator. You would have to write your own iterator class to use an iterator here, which I assume is not what was expected of you.
As Banfa suggested, there is a very simple way to access the elements here.Leave a comment:
-
With, of course, parentheses around the argument list:
Code:int a, b; a = sizeof(b);
Leave a comment:
-
No, neither of those code segments is correct. To declare a variable, you type:
Code:int myInt; char myChar; // etc...
Leave a comment:
-
-
Your code doesn't loop for me...
The following is test code I created to supplement your function:
Code:#include <iostream> using namespace std; int r[12]; void dump() { char value[8]; for(int a = 1; a < 11; a++) { cout << "r" << a << ": \t"; sprintf(value,"%08X", r[a]); for(int
Leave a comment:
-
If these ints are at all related to each other, you can have your struct contain an array of ints, and use array processing techniques to get all the data, convert it, etc.
If this is all your struct contains, however, you have done little more than make a typedef int mystruct[17]; statement.Leave a comment:
-
You can also simply use $company, since the null string is a FALSE value:
Code:if ($company) { print "It's not null.\n"; } else { print "It's null.\n"; }
Leave a comment:
-
This line:
Code:card[51]=c[51];
...Leave a comment:
-
If you are working in a Windows environment, you can execute the "cls" command. If you are working in a Linux environment, you can execute the "clear" command. If you are working in another environment, you can look up the appropriate command line function that clears the screen and execute it.
Be aware that using commands that are OS-specific means that your code will no longer be portable.Leave a comment:
-
It looks like you want either the %ENV variable, or the Env package. Try:
perldoc Env
Using a ModuleLeave a comment:
No activity results to display
Show More
Leave a comment: