>>You say though c is difficult, still better to learn that first for whatever reasons. Again you say "A book on C" is an overkill an he may take a step back because of that.
Don't you find that contradictory?
Not at all, I was suggesting him to, do learn C at first place but at same time don't make it a lot complex. Read the basics first and gradually move to more complex topics. SO I suggested that as a light reading instead of reading python read let us C and then read some intermediate/advanced books on that.
>>Could I ask you a few questions you could answer from "Let us c"
Sure, Let me see If I can still remember this from the book (I think I read it 10 Yrs back, 3rd edition
)
>>What's the size of an integer?
I think "let us c" (read book) do not talk about that. Nor they talk about any platform dependent thing, which I agree is not good but then not a bad practice.
>>What are the different argument passing mechanisms in c?
I think the book does talk about them.(in chapter functions)
>>Is array a pointer? Can arrays be passed? If yes, by value or reference?
>>Is the following code considered cryptic?
>>while(*t++ = *s++)
>> ;
>>assume s,t are char * What's the equivalent?
Not in this book, though probably not even in ritchie. but again has nothing to do with bad practice and his pointer in C does refers this and more.
>>What do you keep in .h file and what in .c file?
This does falls into the category but I believe a starter can do without it, did I say just read let us C, no I didn't I said read it first and then move to some good book
Now let me ask you few thing,
do they tell you that in c++ you can call a function of a class with a pointer of class initialized with null and there will be no crash provided that you do not touch any member variable.
Do they tell that actually *this* pointer get passed through ECX register
Do they tell that when you have some read only variable, how compiler actually put the variable in a read only .rdata section on which loader applies read only page protection attributes.
does any of the book talk about containing_record macro, used a lot in real kernel programming and is real useful
No they didn’t, why because this is not in the scope of what that book was suppose to cover, as some of it is compiler dependent, some of it is OS specific. In same way let us c is a very beginner book which one should read to start things and then move on. OP does not want to read that fine, no problem , but why cursing it man?
Additionally I looked at the link you posted & may be I missed but I didn’t found that poster stated that he got the code from xyz book.
>>The best I remember is, one of the advantages of using structures is "you could clear screen!" with them.
Really :rofl:, which one kanitkar or balagurusamy
>>And would I learn the language differently for academics and for fun?
Yes you do, in fact it’s always the objective which defines your learning. I learned x86 in college but never used it in my professional life apart from few crash dump analysis or sometimes when I was suppose to reverse engineer MS file systems. But now days I am working completely on it, I have recently read it again, with a totally different mindset. In college it was understanding how assembly works and but now its how MS compiler and loader used it and how can I identify a pattern in generated assembly.
I agree with you for some parts but you cannot claim a book is bad just because it do not contain what is there in other books. and I have not read the second book you mentioned but a glance on amazon can easily tell that it covers a lot more than Let us C. So it probably is targeted for different audience altogether. A normal graduate/post graduate, Let us C is a definite pick, an engineering student obviously not.
P.S.: Though not intended, I believe you took it personally, I was just trying to help OP who I believes is a self-learner. So nothing personnel at all. Additionally if OP wants to learn C, why should we bang our heads. we already got enough things to do
.
I hope I make it clear this time.