[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 21 KB, 276x277, electrical engineering.jpg [View same] [iqdb] [saucenao] [google]
2519229 No.2519229 [Reply] [Original]

Hey guys, I taught myself C++ prior to journeying into my EE undergrad.

I'm finding however, we're starting to learn and use a lot more C and I'm wondering what would you guys say is the best textbook to learn C.

Thanks bros

>> No.2519368

>>2519229

>"learned C++"
>doesn't understand C

what the fuck am I reading.

>> No.2519385

>>2519229
To learn C? Write programs.

A Book on C was pretty useful for quick reference and explicit but dry examples.

The K&R book for C is the reference holly bibble for the language but it won't "teach you C."

>> No.2519402

>>2519229
If you already know C++ then you already know C. Just don't do any object oriented programming, use the 'stdio' library instead of the 'iostream' library, and everything will be OK. Oh, and use malloc/free for pointers instead of new/delete. You could easily learn C in a matter of days.

>> No.2519410

I've never used their books for C, and the quality does vary by the author - but I find O'Reilly's books pretty damn good, and they usually tier them in 2 or 3 skill levels, so you can skip the 'beginner' (usually called "learning _____") one if you already have a strong grasp of programming.

>>2519368

It's not a complete mindfuck but they are significantly different and expecting someone to be able to jump effortlessly to C from C++ without any reference/self-teaching is just silly.

>> No.2519428

>>2519368
this, you clearly didn't know c++

>> No.2519436

>>2519410
>they are significantly different
C++ is C with a few new things, some relaxed rules, and lots of syntactic sugar. They are not nearly as different as you may think. In fact, all of the OO stuff you see done in C++ can be done with C as well.

I am concerned that you may not understand C++ as well as you think you do.

Anyway, the best C book out there is "C Programming Language" by Kernighan and Ritchie.

Yes, I did say best. No, that wasn't an opinion.

>> No.2519446
File: 42 KB, 389x500, c_prog_lang.jpg [View same] [iqdb] [saucenao] [google]
2519446

C++ is a superset of C, so if you truly know C++, you should already know C.

Just use malloc instead of new, free instead of delete, and forget about classes, templates, and all the other crap that makes C++ a convoluted mess.

If you really need a book: "The C Programming Language" (aka: "K&R") is still the definitive guide on core C.

>> No.2519504

>>2519446

>and all the other crap that makes C++ a convoluted mess

you're just mad because you don't know how to program in C++

enjoy your outdated shit nigger

>> No.2520557

Stephen Prata's book C Primer is the best intro C book.

>> No.2520566

>>2519446
>all the other crap that makes C++ a convoluted mess.
Entirely unsubstantiated language bigotry going on in here, I see.

>> No.2520572

Good job op now learn c+++ it's what everyone uses now

>> No.2520595

>>2519446
>"The C Programming Language" (aka: "K&R") is still the definitive guide on core C.
>Suggesting that someone should learn K&R C
Were you dropped on your head as a baby or something? That's a completely fucking horrible idea.

OP, learn C if you must / want. It's a fine language. For the love of god don't learn C from K&R. Learn the ISO standardized C, specifically C90.

>> No.2521125

>>2519446
C++ is not a superset of C. There are some syntactic constructs valid in both languages, though having the identical source input they yield different expressions.

Also rules about type casting and integer promotion are slightly different.

>> No.2521171

C is just C++ lite, anyone who says otherwise is a huge faggot and should stfo.

now, what C has that C++ doesn't is a metric fuckton of tools for static code analysis (model checkers and so on), which are crucial for programming critical systems, because their correctness has to be formally verifiable. that's the only difference.