Thanks Grumpy, glad I got a couple good answers out of all the arguments I caused inadvertently!
Still no books recommended, but on my own searching today I found this one... looks like it might...
Type: Posts; User: The111
Thanks Grumpy, glad I got a couple good answers out of all the arguments I caused inadvertently!
Still no books recommended, but on my own searching today I found this one... looks like it might...
I saw some truths in the popular thread below "why new programming students aren't fairing well." I am currently in an online MSCS program, but my undergrad is in Aero Eng and not CS. Because of my...
That makes perfect sense, but it seems slightly at odds with what the text says.
The text says that getint() will break a stream into integers. It doesn't say that getint() will need another...
Sorry if I wasn't clear, but my intent was not to compare C with Java, it was to compare two different learning tools. I am getting along pretty with the syntax and other rules as presented in the...
Oh, so I guess you're saying another function would be clearing the ungetch() buffer?
That makes sense, I guess... but yeah it is very unclear how this function is intended to be used... or what...
As a newbie it is hard to reconcile bugs in the K&R text vs simply things that I do not understand. Also, sometimes the requirements for the sample programs are a little bit vague as to what exactly...
Good call, thanks. Shame on me for not figuring it out... shame on K&R for the typo. :-P
Still trying to wrap my head around all of the code but at least it compiles now.
Yet another noobie K&R question. I'm trying the example in section 5.6 which uses readlines(), qsort(), and writelines() in sequence. The entire messy code is posted way below, but my problem is...
Ok then, back to my original logic treating it only as an example in a book... in the context of that example, where getop() is the only function that calls ungetch(), is it possible to trigger the...
You know, I stared at the original code some more and now I think my confusion is not with getch() or ungetch(). It is with getop(). Since getop() always calls getch() before calling ungetch(), it...
The compiler is Tiny C Compiler. Also, the ungetch() that I'm using is completely defined in the example, it's not a library function. The author explains his code as:
When an extra char is...
I literally thought the same thing myself.
However, my weakest skill at this point in time is reading other people's code, and I figure with a real job in software that is something I'll have to...
Awesome, thanks for the explanations all, and thanks for the link Andrew. I had never heard the term undefined behavior before, but it makes sense.
Any thoughts on the second half of my question?...
The entire code below for reference:
Whenever I try out a code sample from a book like this, I always make it a point to break it. The "MAXOP" defined in the book was 100. So for grins I changed...
[/QUOTE]
Correct... I looked through the winbase.h file before and couldn't find anything which looked like a definition for FindFirstFile, but after looking again I've found some lines:
...
Good info... I will try to process it all. Probably more than I need to know at this point, but I guess I asked for it with all my digging. :-) Thanks.
I didn't change my mind, I perhaps used the wrong words, which I am not even sure at this moment.
Can I call it a "standard C program" if I #include windows.h? If not, then I apologize for the...
And now you're being obtuse. I never once said that it *should* have such a thing, nor that I thought it did.
In fact, in my OP I recognized all of that. Did you read that? :devil:
My...
Well, correct me if I'm wrong (newbie alert), but the difference in my brain is that Windows API is written in C. While C... is C. Which I thought was mostly written in assembly language (which I...
Awesome, I've been hazed! And I agree, I'm sure it could have been much worse, and I'm sure I've been a bigger jerk to people on other forums for asking stupid questions repeatedly. :D
Thank you, I guess that helps most. I did sort of find a reference to it in winbase.h that I missed before. I know I don't *need* this info to solve my problem... it's more just curiosity. Coming...
Well, if you look at the example here:
FindFirstFile Function (Windows)
There are only 3 #include lines at the top of the program, and none of those .h files define the function "FindFirstFile"...
Thank you so much everybody for the quick answers.
Really stupid question incoming:
I don't really have experience using external API's. So if I am using a function called...
Thanks for the reply. I am pretty sure I'd like to stick with Windows.
I just found out about something called dirent.h, is that something that could help me?
I am a relatively new programmer with a decent foundation in Java (went through the entire Headfirst book last month), but I am much weaker with C/C++. I plan on going through a more comprehensive...