>What could be causing this??
It sounds like the Enter key got stuck in your stream. :) When you use fgetc or any of its buddies to read a single character, the stream actually gets two characters...
Type: Posts; User: Slacker
>What could be causing this??
It sounds like the Enter key got stuck in your stream. :) When you use fgetc or any of its buddies to read a single character, the stream actually gets two characters...
>I really thought it got easier after grasping pointers and data types.
Not really. :D It's like math. Once you grasp arithmetic they throw algebra at you, and once you finally get algebra, you get...
lpp is a pointer to a pointer to struct list, but presumably the next pointer is just a pointer to struct list, so the first thing that needs to be done is be able to get to the members by...
>http://www.daniweb.com/code/snippet148.html
Heheh, cop out. :p
That's about what I was thinking, though it doesn't accurately give you the value bits for a signed type. If you use one of the MAX...
>an int may contain padding bits.
Sorry Mr. Sinkula, but I'm not going to let you off the hook that easily. :) I believe that you're talking about trap representations and how the number of...
int** and int (*)[N] are completely different. I like to stay upbeat and avoid being too negative when I describe stuff, but this is one situation where you just can't trick the compiler into being...
>Another legitimate place for a type cast is when converting a void * to a known type or vica-versa
Only if you're using a REALLY old compiler, or C++. C has allowed implicit conversions to and from...
Well, Linux people are always trying to convert non-Linux people, so being anti-social is against the cult creed, I think. :p
>what would you recommend using with file io, binary or text mode
Text is easier to work with and more portable, so it's usually what I use. But since you're learning, work with both to get a feel...
Well, for(;; ) is technically always true, so it doesn't matter. :) But in general, conditional tests by default test for != 0. That's why
if ( x ) {
/* Stuff */
}
Executes the block if x...
The result of a%b is the remainder of a/b.
>i really don't see the problem with it if the program is written in a personal context
As long as it actually works (ie. documented on your compiler) and nobody sees you use it, there isn't a...
But it's still recommended. Otherwise when good, useful code is ported to another system--you do write good, useful code, right? :)--forgetting to add the binary orientation could cause some...
Pair Networks. Their first non-FTP package is like $5.95US, their hosting rocks and they have great service. :)
>I'll read a few, and reply to one, and suddenly none of the threads on the entire site are unread.
How long do you read or reply without previewing or refreshing the page? I've noticed that if you...
>how do you input strings into a buffer while in binary mode
The same way you do in text mode. The only difference is that text conversions aren't made, so if the file has a CR LF pair that's...
>when you make the switch to C++ you have bad habbits from prgramming in C
And vice versa. :) C and C++ idioms are different enough that you'll have issues no matter which you start with. Just pick...
const char *content[] = {
"echo reply",
"unassigned",
"unassigned",
"destination unreachable",
"source quench"
... and so on until 255
};
...
>error C3861: 'time': identifier not found
That program had a bug in that it didn't include time.h. That usually ends up working in C, but fails miserably in C++ because C++ requires a prototype.
>i have the ebook and its the second edition
K&R isn't available electronically. You're reading a pirated copy that's probably filled with typos and errors, unlike the actual printed book.
Cheers!
>How did you master pointers?
Heheh, master pointers. :rolleyes: :p Some people might tell you that I've mastered pointers, but some people will say anything. ;) Personally, I don't think it's...
>Is the part in red necessary if I exit the program right after displaying the error message?
Necessary? Nope. :) But it's definitely a good idea, especially since nobody tries to write bad code,...
>so the problem is how to insert the text using C.
You need to rewrite the entire file, inserting the lines you want as necessary during the rewrite. Unless your system supports record oriented...
>That's not really a very strong claim.
Neither is yours. :) NULL is another way to say 0, so that part of the example is pretty silly. '\0' is also another way to say 0, a char is really a small...
>even though it's a function?
Yep, only the first dimension can be omitted because the "array names become a pointer to the first element" rule only applies to the first dimension of a...