Wooow. That's exactly the sort of thing that I'm looking for! Thanks, it's always good to learn new things. Jesus, this is pretty spot-on. That's brilliant. Thanks a lot! Oh, and it seems you know...
Type: Posts; User: mszegedy
Wooow. That's exactly the sort of thing that I'm looking for! Thanks, it's always good to learn new things. Jesus, this is pretty spot-on. That's brilliant. Thanks a lot! Oh, and it seems you know...
Yeah, sorry, I meant to && them. :P I'm so absentminded sometimes... it's all a moot point, though, because I'm using isdigit(num [i]) now.
I don't want to make my variables global, though, and I'm not very good with pointers to arrays. I guess I could make it return the value to put into current, though! Thanks, I'll try that.
...
Hi,
So, I have a file parser that, at one point, takes input of the form of "h(124) c(566) f(178)" and reads it into variable array current [7]. It will only accept l(), h(), a(), v(), c(), or...
I'm the only person using the program: there's no point in sanitizing the input if I make sure not to do anything stupid.
@patricio2626: For your first suggestion, it went up to 30 and then...
At this point I've replaced it with a separate function. No good, but cleaner. Looking at a compilation of the older code, it's... the same thing as tmpxp1. Huh.
But it crashes before even a single iteration. It's not like it's 10000000000000 or anything. It's 100. I get the same error if I use 123 as the seed.
(If there's a simpler way to get the nth...
Urr, I got it to compile again but it still says I'm dividing by zero. I swear I'm not! I specifically raised initial n to 2 to combat this nonsense. I'm passing ints into modulus and everything......
Thanks for the explanation! It doesn't exactly work yet: modulus is being highlighted as only taking doubles, which makes no sense, but thanks a lot! I think I know what I'll try, then...
But why do they need to be doubles? D:
Darn it. I was suspecting this, so I looked it up, and I concluded that ^ means exponent. But, now that I think about it, must've meant bitwise AND. What's exponent?
EDIT: Looked up exp (x, y),...
Here is my code. Its purpose is to test my method for generating pseudorandom numbers for my diamond-square algorithm terrain generator. It was supposed to be a proof-of-concept, to see whether the...
Well, I was originally gonna have g_b_t return an array of chars, but it refused to accept that, so it was made into a global variable.
Maybe I'd be better off writing this in Lisp... :P
Here's a blood typing program I wrote on a sick bag on an airplane; it's been giving me mounds of trouble. The latest development is that when I try to print the blood types it doesn't show anything....
First off, EOF is not a valid variable- I haven't found it declared anywhere in the program (Unless there's a reserved C command I should know about?), so I'm assuming you attempted to multiply...
Ooh, this sounds fun. I love genetics. I won't actually write the code for you, but I'll definitely create a version for myself and if you have any bugs we'll compare.
Yep. The first time you define computesums has to match up with the second time you define computesums. Change the argument of the first definition to match the second definition. Alternatively, you...
Uh, forget it. I fixed everything. You can close this topic (can you forgive me for posting three times in a row? It's not to increase my postcount, but to alert people that something new has become...
Wait. I fixed something in main. Now it looks like:
int main()
{
char a; // Input for player.
setsafe(); // Sets the char representation of the safe to 0, 1, 2 ... 9. Also sets num to a...
I'm using xcode's built-in C compiler. I'm not sure how to make it compile with C99. Plus, I'm not really using it as a bool anymore. I'm using it to store two bits (numbers 0-2), rather than a...
New problem. See edited first post.
Yes. So, I believe this topic can be closed.
I was simply remarking on how inappropriate his tone was (not to be hypocritical, but if someone said that in real life to some guy who just wanted help I would definitely shout, "Oi, shut up!" at...
Wait, he's offline. I'd better go to sleep (it's 3:30 AM where I am).
Yes, telling someone (s)he is "wasting our time" is a very quick and efficient way of solving a problem.
Perhaps (s)he doesn't know what his/her compiler is trying to tell him/her. It is very hard...