Author Topic: C or C++  (Read 6450 times)

0 Members and 4 Guests are viewing this topic.

Offline Traitor4000

  • Knight
  • **
  • Posts: 191
  • Cookies: 8
    • View Profile
C or C++
« on: 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.
The most vulnerable part of an impenetrable system is those who believe it to be so.

Offline kenjoe41

  • Symphorophiliac Programmer
  • Administrator
  • Baron
  • *
  • Posts: 990
  • Cookies: 224
    • View Profile
Re: C or C++
« Reply #1 on: 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++ and/or C++ How to program by deitel 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.
If you can't explain it to a 6 year old, you don't understand it yourself.
http://upload.alpha.evilzone.org/index.php?page=img&img=GwkGGneGR7Pl222zVGmNTjerkhkYNGtBuiYXkpyNv4ScOAWQu0-Y8[<NgGw/hsq]>EvbQrOrousk[/img]

Offline vezzy

  • Royal Highness
  • ****
  • Posts: 771
  • Cookies: 172
    • View Profile
Re: C or C++
« Reply #2 on: 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 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++/ (for lulz)
« Last Edit: September 02, 2013, 10:47:03 pm by vezzy »
Quote from: Dippy hippy
Just brushing though. I will be semi active mainly came to find a HQ botnet, like THOR or just any p2p botnet

Offline rasenove

  • Baron
  • ****
  • Posts: 950
  • Cookies: 53
  • ಠ_ಠ
    • View Profile
Re: C or C++
« Reply #3 on: 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.
My secrets have secrets...

Offline Xires

  • Noob Eater
  • Administrator
  • Knight
  • *
  • Posts: 379
  • Cookies: 149
    • View Profile
    • Feed The Trolls - Xires
Re: C or C++
« Reply #4 on: 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++.
-Xires

Offline Traitor4000

  • Knight
  • **
  • Posts: 191
  • Cookies: 8
    • View Profile
Re: C or C++
« Reply #5 on: 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
« Last Edit: September 03, 2013, 01:48:45 pm by Traitor4000 »
The most vulnerable part of an impenetrable system is those who believe it to be so.

th3g00n

  • Guest
Re: C or C++
« Reply #6 on: 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

Understanding ans Using C Pointers (you'll need this when/if you're having trouble understanding pointers)
« Last Edit: September 03, 2013, 01:59:22 pm by th3g00n »

Offline Traitor4000

  • Knight
  • **
  • Posts: 191
  • Cookies: 8
    • View Profile
Re: C or C++
« Reply #7 on: 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
The most vulnerable part of an impenetrable system is those who believe it to be so.

Offline Traitor4000

  • Knight
  • **
  • Posts: 191
  • Cookies: 8
    • View Profile
Re: C or C++
« Reply #8 on: 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.
The most vulnerable part of an impenetrable system is those who believe it to be so.

Offline namespace7

  • Sir
  • ***
  • Posts: 561
  • Cookies: 115
  • My Brother's Keeper
    • View Profile
Re: C or C++
« Reply #9 on: 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 :)
"A programmer’s greatest enemy isn’t the tools or the boss or the artists or the design or the legacy code or the third party code or the API or the OS. A programmer’s greatest enemy is getting stuck.
Therefore a crucial step to becoming a better programmer is learning how to avoid getting stuck, to recognize when you’re stuck, and to get unstuck." -Jeff Wofford

Offline Xires

  • Noob Eater
  • Administrator
  • Knight
  • *
  • Posts: 379
  • Cookies: 149
    • View Profile
    • Feed The Trolls - Xires
Re: C or C++
« Reply #10 on: September 03, 2013, 11:36:16 pm »
Screw the books, just pull the compiler apart & learn from there.  Best way, really.
-Xires

Offline kenjoe41

  • Symphorophiliac Programmer
  • Administrator
  • Baron
  • *
  • Posts: 990
  • Cookies: 224
    • View Profile
Re: C or C++
« Reply #11 on: 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.
If you can't explain it to a 6 year old, you don't understand it yourself.
http://upload.alpha.evilzone.org/index.php?page=img&img=GwkGGneGR7Pl222zVGmNTjerkhkYNGtBuiYXkpyNv4ScOAWQu0-Y8[<NgGw/hsq]>EvbQrOrousk[/img]

Offline Traitor4000

  • Knight
  • **
  • Posts: 191
  • Cookies: 8
    • View Profile
Re: C or C++
« Reply #12 on: 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)
« Last Edit: September 04, 2013, 03:47:52 am by Traitor4000 »
The most vulnerable part of an impenetrable system is those who believe it to be so.

Offline Xires

  • Noob Eater
  • Administrator
  • Knight
  • *
  • Posts: 379
  • Cookies: 149
    • View Profile
    • Feed The Trolls - Xires
Re: C or C++
« Reply #13 on: 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.
-Xires

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: C or C++
« Reply #14 on: 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.
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python