EvilZone

Programming and Scripting => C - C++ => : Traitor4000 September 02, 2013, 09:35:49 PM

: C or C++
: Traitor4000 September 02, 2013, 09:35:49 PM
So about a month ago I learned C from the book Teach Yourself C in 21 Days i followed that course. I then proceeded to learn from learn C the hard way and other tutorials i could find. I'm beginning to regret that. I figured after learning C i could just learn C++ really easily afterwards. However now i realize i was wrong. The syntax looks completely different and there are a bunch of these "<<". So basically will i be behind knowing only C. If so is there a. a book or tutorial you  would recommend for learning C++ b. a book or tutorial that teaches C++ in a way for those who know C.
: Re: C or C++
: kenjoe41 September 02, 2013, 10:37:40 PM
Behind? With only C? Come on. You have way too much power way down to as close to the machine as you can be, so don't you dare undermine yourself.
Well i admit the syntax of C++ is alittle different but its not that hard/different (its like america to british english).
If you stay with C only, you will be missing the Object-Oriented programming part that is so much inpractice in the industry today, so if you can help it, man up for C++.

    a) Well i would recommend Starting out with C++ (http://eembdersler.files.wordpress.com/2011/07/c_early.pdf) and/or C++ How to program by deite (http://http://evilzone.org/ebooks/c-how-to-program-8th-edition/)l for any total beginner cos this is the best explaination they can get but you aint no beginner though they carter for C programmers. The difference is that you get to understand the explainations pretty fast cos C++ is derived from C but you really have to relearn a new syntax, forget afew of C stuff and write alot of classes.

    b) I vouch for those books above but there aint no book with all C++ in it. You've got a learn the new syntax so you better start like a beginner though ret assured you will catch up sooner.
: Re: C or C++
: vezzy September 02, 2013, 10:45:01 PM
"<<" is a bitwise shift. You were probably referring to accessing the C functions to print to standard output.

This has been discussed to death, even here on Evilzone. Look up "C vs. C++" on any search engine and enjoy the infighting. But nonetheless:

It seems to me that you've been learning from awful resources (except for Learn C the Hard Way, which is quite decent). Protip: avoid any book titled "Teach Yourself X in Y t". These tend to be poorly written for the lowest common denominator and often have erroneous syntax or they display poor coding conventions. Read this article by Peter Norvig (http://norvig.com/21-days.html) to get a more realistic view.

How exactly do you consider yourself being behind knowing C? You have to realize C was written back in a time when hardware was constrained, efficient allocation of memory and resources was crucial to writing programs and most systems programming was still done in Assembly (machine code mnemonics).

Now that you've started with C, you should continue because it'll give you a very solid foundation for programming later on. You'll learn memory management, pointers and basic low-level concepts, not to mention that a good amount of modern programming languages all descended from C. C is also very likely the underlying language of your operating system, for instance. Your system was designed to handle C, and it is still the goto (pun intended) language for embedded systems and anything that requires interaction with the internals of an operating system.

C and C++ are completely different beasts. C is inherently much simpler than C++. C++ is a gargantuan and behemoth of functionality, most of which people don't use all too often. Rather, most people treat C++ as C with Classes. Not to say you shouldn't learn it, but be weary of it.

Other books on C you would be interested in: K&R C (yes, the gospel, can't go without it), C Programming: A Modern Approach and once you've reached a certain level, try going into Expert C Programming: Deep C Secrets, which will both teach you and no less amuse you.

Finally: http://harmful.cat-v.org/software/c++/ (http://harmful.cat-v.org/software/c++/) (for lulz)
: Re: C or C++
: rasenove September 03, 2013, 05:35:55 AM
Traitor4000, the book you mentioned is more of a reference than a bigenners book. Also i suggest C++ primer plus for you, it's writer (my teeth fall off when i try to pronounce his name) often explains the diffrence bitwen the two languages, and i mean every programming element. I found it not too hard to understand C code (i didn't learn C) after fineshing this book. Also you should learn both of em, it's not so hard, just remember and forget a few things and you are good to go. But learn one at a time.
You can find the book in the ebook section.
: Re: C or C++
: Xires September 03, 2013, 08:09:34 AM
C++ is essentially a superset of C.  That is not to diminish it as a language of its own merit; I'm just stating fact.  As such, knowing C prior to learning C++ will always put you a step ahead, not behind.  C++ introduces some new & interesting features like function overloading, stream-based I/O, templates, etc.

Plain & simple; you're better off knowing C before starting C++.
: Re: C or C++
: Traitor4000 September 03, 2013, 01:31:38 PM
Ok so basically what im getting here is (since i am currently doing another learn C in 40 days) drop those completely which of these would you recommend for completely beginning C cause i realized most of the 21 days actually didnt teach much so guess it  probably best to start with repaorong the foundation befoe i move po to more advanced things. Cause I feel like a modern approach to C will probably be more geared towards people who already know the language. I also just did some googling and some arguments came up about if k&r is still valid given it was released before C was standardized. So now afte falling into a few traps Im a bit wary going through a book with errors because it isnt standardized. Oh and forgot for k&r are we reffering to first edition or second? Because the second does say on the cover ANSI C
: Re: C or C++
: th3g00n September 03, 2013, 01:57:40 PM
Ok so basically what im getting here is (since i am currently doing another learn C in 40 days) drop those completely which of these would you recommend for completely beginning C cause i realized most of the 21 days actually didnt teach much so guess it  probably best to start with repaorong the foundation befoe i move po to more advanced things. Cause I feel like a modern approach to C will probably be more geared towards people who already know the language.
If you're looking to relearn C, then C Programming: A Modern Approach should be your best option. It was written for a broad range of readers; someone who's never programmed before will be able to get along fine with this book. I can't upload any of the books right now so, I'll have to post links here.

DOWNLOAD LINKS:
C Programming: A Modern Approach (http://thepiratebay.sx/torrent/5580017/)

Understanding ans Using C Pointers (http://it-ebooks.info/book/2265/) (you'll need this when/if you're having trouble understanding pointers)
: Re: C or C++
: Traitor4000 September 03, 2013, 02:28:00 PM
Ok ill hop to it. And start reading after school and homework my Intro to computer science class is such a joke
: Re: C or C++
: Traitor4000 September 03, 2013, 10:44:43 PM
Uh one question which starting out with c++ book are you recommending there are like thousands of different books that come up the download for me is broken cant open the file. Could be on my end but i dont think so cause i open it but the bar just fills immediately then freezes and the book wont display so i click download but i think the file is broken.
: Re: C or C++
: namespace7 September 03, 2013, 11:15:23 PM
If you have no good reason to use and learn C++, then why would you want to learn it? Whats your motivation?
I would just learn C really well instead.

But its up to you.
Also its always good to understand how computers actually work.
Code: The Hidden Language of Computer Hardware and Software is a good book to get started.

If you REALLY insist on learning C++ then really, there are tons of books. Just go to the ebooks section and get something like C++ Primer Plus or something else that has a decent reputation and reviews. C++ Primer Plus was my first C++ book and I found it to be OK. As long as you are patient and dedicated it will do the trick.

Good luck :)
: Re: C or C++
: Xires September 03, 2013, 11:36:16 PM
Screw the books, just pull the compiler apart & learn from there.  Best way, really.
: Re: C or C++
: kenjoe41 September 04, 2013, 12:18:21 AM
Screw the books, just pull the compiler apart & learn from there.  Best way, really.
You really are something @Xires, careful with the tofu (kid), he might come out to hard to chew, you are gonna get him hitting his head on the wall.

@OP i get you 2 links that are working just fine for me and the helped me alot for starters. Better make a decision. Is it C or C++? Whatever you choose (which is your choice not ours) we shall help out. Don't go hitting you head on a wall with all that Xires' advice, its gonna get you grounded.
: Re: C or C++
: Traitor4000 September 04, 2013, 02:00:17 AM
Well i think i need to learn both C and C++ but thiswhole year is gonna be all C i think. I just like to file away pdfs away for when i need them. For instance i combed through your tutorials section and archived anything i thought i might like to learn in the future. (ill try the link again)
: Re: C or C++
: Xires September 04, 2013, 08:19:49 AM
In seriousness; it's definitely worth-while to also learn C++.  With C you can mold the raw elements of computing together in various forms to create virtually anything you can imagine.  With C++, you can architect a world of sophistication & complexity with subtle ease & elegance.  C instills a sense of efficiency, knowing the cost of each element.  C++ provides flexibility, knowing form & function for each structure.  Combined, flexibility & efficiency can grant the power of near-infinite creativity.  Art is born.

There are many, many other languages out there to be learned.  Armed with knowledge of both C & C++, all others become easier to learn.  Mastery takes a very, very long time.  Over the years, I have learned that one cannot master 1 language without knowing others.
: Re: C or C++
: lucid September 04, 2013, 10:05:03 AM
In seriousness; it's definitely worth-while to also learn C++.  With C you can mold the raw elements of computing together in various forms to create virtually anything you can imagine.  With C++, you can architect a world of sophistication & complexity with subtle ease & elegance.  C instills a sense of efficiency, knowing the cost of each element.  C++ provides flexibility, knowing form & function for each structure.  Combined, flexibility & efficiency can grant the power of near-infinite creativity.  Art is born.

This alone makes me want to drop everything else I'm learning in order to dedicate my full time to C.
: Re: C or C++
: geXXos September 04, 2013, 01:42:11 PM
This alone makes me want to drop everything else I'm learning in order to dedicate my full time to C.

Ha, same here man. I shouldn't read this post. XD
: Re: C or C++
: chapp September 04, 2013, 09:33:05 PM
One of the main reasons to learn C is to understand what's going on and starting with the kernel bit by bit is a great way when you know the basics. When you see some syntax you don't recognise you can always look it up.


https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/?id=refs/tags/v3.11
: Re: C or C++
: $trik3r June 17, 2014, 09:24:54 PM
i am currently reading that book now ... is it good or not ... what is your opinion on the book ???
: Re: C or C++
: Rytiou June 17, 2014, 09:44:31 PM
are there any thread specifically does only Coding 0n C ???
You know if you have simple questions there's always that nifty little search button and there's this thing called Google. Also, it's really annoying when people double post and unintentionally gravedig threads for no necesseary reason so you should really refrain from doing so.
: Re: C or C++
: Kulverstukas July 08, 2014, 07:15:17 AM
Well, I think it's better to say that C is as close to the machine language as a high-level language can get.