Hi all, for some reason I thought it would email me when this topic received replies, but it didn't, so I just now saw the replies & wanted to say thanks!
Type: Posts; User: SCRIPT_KITTEH
Hi all, for some reason I thought it would email me when this topic received replies, but it didn't, so I just now saw the replies & wanted to say thanks!
Hi all,
Been quite some time since I've posted here or practiced C for that matter, but recently starting to get back into it.
I was reading in a book I had about C that an array has at the...
Ohh, I see! That makes a lot more sense, thank you!
Hi folks,
I have an end of chapter question here, that I believe I have solved, but am not sure if I've understood the question correctly in the first place. What do you think this question is...
Oh, wow, thank you for the detailed response! I haven't made any programs or functions that would be advanced enough to warrant an entire "source tree," but I have a few input getting functions I...
Hi folks,
I have just learned about how one can put functions and headers in different files from the main() function. I was wondering if there is a rule of thumb of when and when not to separate...
Yeah, I think I got it. The implied return was never reached until n < 4 test failed, hence why that is the point it started "returning" back out :) Thank you!
Ohhh, I was not aware of void functions having an implied return. This is good to know! Thanks, anduril! I wish I could express my gratitude for y'all's help all the time in some way better than...
Hi folks,
As usual, reading about C, have hit a wall that I'm struggling to overcome, "recursion." As I understand it, it's like a function calling itself. This is the short program the author...
Ohhh, Thank you, Matticus! :D I see from your link the idea is used in many programming languages, interesting.
Hi folks,
In my reading of a book about C, in the chapter about functions, I've come across an expression that I don't understand, and was hoping someone could explain. First the author shows...
Futurama Fry - not sure if c has taught me to think like a programmer or py
No problem, I'm pretty new at this too :redface:
if(scanf("%d", &num1) != 1)
{
get rid of bad input
}
When scanf tries to read input, it "returns" the number of correctly read items. So scanf("%d", &num1) != 1 means, scanf did not...
AHHH, I love you! :o Yeah, the commented part was left over from something I was trying to fix the original problem, but adding those two lines into the get_int function did the trick! Thank you so...
Hi folks,
A long time ago I posted a program that I made on this forum about conversions, and I was asking how it could be cleaned up. Several people suggested functions, but I wasn't...
Ahhh, the *stream*, not scanf... Thank you very much!
Sorry, I meant at the OP. I found it kind of funny his making a forum post called "c" and commanding the reader to make a program :p
Hi folks,
So In my studying of C I am starting to come across more programs with functions in them. I am more comfortable with them than I used to be, but I have a couple of questions about this...
dafuq :confused:
@ Nominal, I follow you up to the last part. I wasn't talking about the 1 being printed twice/increment thing there, I meant that if you *don"t* have the while(getchar()) != '\n' inside the outer...
Thank you!!! It's much more clear now. It helps me learn so much when y'all experts take me through the, sequence points ;), one bye one.
That makes sense... Thank you.
K, I'll try:
So first the getchar() function awaits the user to input something. If the input was not 'y', which would terminate the loop, then the if/else...
Hi folks,
I have here a program from one of my books about C and I want to verify that I am understanding correctly how it works. Here is the program:
#include <stdio.h>
int main(void)
{...
Ha, good point.
That did the trick! I had no idea you could do that. Thanks!