I don't know what kind of tools I have at my disposal in the TopCoder arena, really. My professor has a driver program, but whenever I try to compile the whole program, the compiler complains about...
Type: Posts; User: MSZShadow
I don't know what kind of tools I have at my disposal in the TopCoder arena, really. My professor has a driver program, but whenever I try to compile the whole program, the compiler complains about...
Yeah. I'm not responsible for the main program, which obtains those values.
I'll add some sample data, in the event someone tries to check my logic:
Sample values can look something like this:...
I haven't used switch-case statements in a while (because my classes decided to drag me through C and assembly for two semesters), but I'm pretty sure it'd be easier to take your input as an integer,...
Yeah, I realize that.
For clarity, I ran that code with the same set of input while changing that statement to see when it would stop causing a seg fault. Nothing else in the code changed.
...
I know that. But assuming curBall exists, the boolean expression curBall->high != NULL shouldn't cause a seg fault, right...? After all, you're testing to see if curBall->high exists.
Edit: If you...
So, I'm having issues with a certain seg fault. I don't really understand what's causing it.
I can perform the following operations with curBall, which is class Ball* type.
curBall->val
curBall...
I'll look into those. Thanks.
As part of the process for narrowing down where the error was, I placed a cout statement on the line immediately before the line where I attempted to use curSong. It seg faulted before it printed the...
That...would be a good idea, yeah.
Actually, my compiler never gave me that warning.
However, it actually seg faults before it ever tries to use curSong.
I'm currently writing part of a lab program for a data structures class I'm taking. I'm only partway into the lab, so there's not much written at the moment.
First, let me apologize in advance....
Ohh. -facepalm-
I'll change it to access the bits in the opposite order, then. (0-7)
And let's see what happens...
EDIT: Alright, now the output for that number is
25.812500
0 | 10000011 |...
25.812500
1 | 00000100 | 11100110000000100000000
That's the current output I'm getting. The last times I continuously ran it, though, the binary output would change occasionally.
Even with...
Unless I'm going crazy, I'm pretty sure I have it set to run through bits 7-0 (8th-1st) of each element in the array.
Notice later on, I decrement h by one, until it's less than 0, when I set it...
Trying to do a lab in a Computer Organization class using C. The goal of this part is to make a character array representation of how a given float looks to a computer. I wasn't given much...
Thanks guys. The error was fixed by changing the bugged line to
if(tree->root == NULL)
After that, there were a small number of logic errors in my main program, which I fixed. Now it's working...
Yeah, but I'm not too good at using gdb yet. I managed to use it to trace the error back to that point, but can't get much more out of it. I'll go try again.
Edit: It's giving me different...
Hey, I'm trying to write a program using binary search trees. Everything seems to work up to a certain point, which (as far as I know) shouldn't produce an error. It segmentation faults while it's...