I never got a chance to thank him...
Type: Posts; User: MikeyIckey
I never got a chance to thank him...
I think you may be the only person to have made this sad waste of server space make me smile.
Thank you!
:D
Leave. Now.
Also, I noticed that you have the function after main(), which is OK, but you don't have a function prototype anywhere stating that you're going to have a function called "calculateCharges". If it...
so, for pure readability, you're not a fan?
yeah, i liked that too.
That's some pretty impressive functionality, actually.
OK, Mr. Naung, you've convinced me. That's a pretty interesting (and useful) use of the ? operator!
Thanks for everyone's replies.
-M
No, it's an interesting way to branch code. I just learned about it about (even though I think it's been in the C spec since K&R ansi c) so I was just wondering how often people see it, is it...
The "?" conditional operator, for those that aren't aware, acts very much like a an if...else statement:
z = (x>y) ? x : y;
is similar to
if (x > y)
z = x;
else
z = y;
It kind of looks like you're trying to do a bubble sort.
C Primer Plus, It covers C99.
The option to force GCC to use the C99 standard is "-std=c99" I believe.
You should confirm with your man pages.
Hey!
I thought you might like to take a look at Beej's guide to C programming.
Also, if you need a book, the forum members have a really extensive list of books in the sticky post at the top of the...
Also,
void main(void)
is bad.
here's why
Sorry to be a bit off topic I know it's not related to your question.
why would I remove that? I'm multiplying 3 times the value of num1.
So the way I did it, i was playing with the address not the value, correct?
I thought that because it is an array of pointers it would be easier to use pointers to use it.
Or I'm just so anxious to write really sophisticated programs I blindly decided to use pointers where...
I thought I needed to use pointers because I was using argv.
Hehe, well I was always curious about how the wheel worked.
I thought I was taking integers from the command line.
Am I not?
I know I've posted this code a couple of times now so I feel really stupid asking again for help but the requirements for the challenge that I'm working on changed a little bit on me.
What I now...
Ooooooh. I get it!
Man I feel stupid, I should have seen that!
Thank you so much.
I've run the code through a debugger and made the above changes (thanks again, my head was about to explode). The guts of the code work, but it never stops the loop when it's equal to one. When I run...
Ok, I need argv[1] and argv[2], then, and to convert those to an integer.
Thank you. I'll see what happens.
I have another problem with command line arguments.
But this time I'm mostly convinced that it's how I've set it up.
This program takes two numbers from the command line. The first and presumably...