12 Replies - 19196 Views - Last Post: 07 July 2015 - 03:13 PM Rate Topic: -----

#1 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1416
  • View blog
  • Posts: 8,022
  • Joined: 07-September 06

The C/C++ Learning Series

Post icon  Posted 06 June 2015 - 04:34 PM

C/C++ Learning Series

The C/C++ Forum Leaders and Experts are rolling out a new series of tutorials with the focus of providing a learning path for new C/C++ developers. As each tutorial is written, the entry in the list will be replaced with a link to the tutorial. Our goal is to fill in every entry, along with even more if any are requested.

Topics

General:


C:
Novice
  • Primitive Types
  • Basic Operators
  • Control Structures (loops, ifs, and switch)
  • Basic Collections
  • Functions
  • Understanding the Compiler Output
  • Structs

Intermediate
  • Malloc, Free, and the Heap
  • Pointers
  • Linked Lists
  • Recursion
  • String Manipulation
  • An Introduction to Debugging
  • Function Pointers

Advanced
  • Threading
  • Sockets
  • Shared Objects: What are they and how do I use them?
  • A Simple Chat Program Part 1: Listening
  • A Simple Chat Program Part 2: Adding a Client
  • A Simple Chat Program Part 3: Multiple Clients
  • A Simple Chat Program Part 4: Threading


C++:
Novice
  • Primitive Types
  • Basic Operators
  • Control Structures (loops, ifs, and switch)
  • Basic Collections
  • Functions
  • Understanding the Compiler Output
  • Classes, Structs, and Objects

Intermediate
  • Namespaces
  • New, Delete, and the Heap
  • Pointers
  • References
  • Data Encapsulation
  • Linked Lists
  • The Singleton Method
  • Virtual Classes and Interfaces (Polymorphism)
  • Templates
  • Recursion
  • In Depth Collections
  • Standard String Manipulation
  • An Introduction to Debugging
  • Exception Handling
  • Function Pointers

Advanced
  • Functors, and Lambdas
  • Threading
  • Sockets
  • Shared Objects: What are they and how do I use them?
  • A Simple Chat Program Part 1: Listening
  • A Simple Chat Program Part 2: Adding a Client
  • A Simple Chat Program Part 3: Multiple Clients
  • A Simple Chat Program Part 4: Threading


Spoiler


If you come up with any topics that you don't believe are covered, feel free to post in this thread and I'll see about adding them to the list.

Thanks for reading!

Is This A Good Question/Topic? 3
  • +

Replies To: The C/C++ Learning Series

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1416
  • View blog
  • Posts: 8,022
  • Joined: 07-September 06

Re: The C/C++ Learning Series

Posted 06 June 2015 - 04:42 PM

This post will be modified and updated to list all contributors to the series. If you submit a tutorial that is added to the series your name will appear here. You don't have to be a forum leader, or expert to be included in this list.

BetaWar
Was This Post Helpful? 0
  • +
  • -

#3 jimblumberg  Icon User is offline

  • member icon

Reputation: 5083
  • View blog
  • Posts: 15,924
  • Joined: 25-December 09

Re: The C/C++ Learning Series

Posted 07 June 2015 - 03:18 PM

Why are you proposing writing these tutorials to the outdated and depreciated C and C++ standards (C90 and C++98). This is 2015 and there are at least two more current standards available for both languages(C99 and C11, C++11 and C++14) I suggest you write the tutorials to conform to the latest standards not the depreciated decades old standards.

Also IMO C and C++ are different enough that they should be treated separately trying to write even simple tutorials that adequately cover both languages will tend be error prone and confusing.

Jim
Was This Post Helpful? 3
  • +
  • -

#4 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 387
  • View blog
  • Posts: 1,662
  • Joined: 16-May 09

Re: The C/C++ Learning Series

Posted 07 June 2015 - 07:55 PM

Quote

Also IMO C and C++ are different enough that they should be treated separately trying to write even simple tutorials that adequately cover both languages will tend be error prone and confusing.

+1! This is one big reason why people get lost in learning C++. Also, there are new topics for C++11/14 that are worthy of good tutorials :)
Was This Post Helpful? 1
  • +
  • -

#5 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1416
  • View blog
  • Posts: 8,022
  • Joined: 07-September 06

Re: The C/C++ Learning Series

Posted 08 June 2015 - 09:00 AM

I have actually been debating as to whether or now we should split up the tutorials and have basically a 1-to-1 list of C and C++ tutorials. If you guys think it is a better plan we can go ahead and switch over to that route. As you can see from above, I have already split some of the tutorials out to one language or the other (such as the new/ delete tutorial being C++, and the malloc/ free tutorial being C).

I am also fine with switching the standard, the only reason I started out with the ancient one was because that's what most colleges are likely going to use (profs are notoriously bad at updating their materials to stick with the times). I also have no problem with changing the standard (especially since we are early on in the process, and even in the Hello World tutorial, I didn't worry about specifying the standard to the compiler).
Was This Post Helpful? 0
  • +
  • -

#6 jimblumberg  Icon User is offline

  • member icon

Reputation: 5083
  • View blog
  • Posts: 15,924
  • Joined: 25-December 09

Re: The C/C++ Learning Series

Posted 08 June 2015 - 10:02 AM

Quote

I have actually been debating as to whether or now we should split up the tutorials and have basically a 1-to-1 list of C and C++ tutorials. If you guys think it is a better plan we can go ahead and switch over to that route.

Splitting them would be my suggestion, but don't have two topics, just group them separately.

Also note on the standard issue, gcc/g++ default to gnuXX which has compiler specific extensions to the language. I recommend specifying a C/C++ standard and to compile with the -std=c++XX -g -Wall -Wextra -pedantic compiler flags at a minimum. This provides for most of the common warnings and adds debugging information to aid in debugging. The -pedantic flag disables all the compiler specific language extensions. But realize when dealing with C, specifying a standard higher than the ancient C90 standard can cause problems with the outdated Microsoft C compiler (any and all versions of the compiler are deficient), and IMO we should just warn against the use of this outdated C compiler Their C++ compiler has tolerable C++11 support, I'm not sure about it's support for C++14.

I also recommend breaking the topics into beginner, intermediate, and advanced sections. And for the beginner I recommend the setup stages use IDE, not command line. Most of our beginner users are using IDE not the command line, the command line is not usually stressed until much later.

Jim
Was This Post Helpful? 1
  • +
  • -

#7 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 387
  • View blog
  • Posts: 1,662
  • Joined: 16-May 09

Re: The C/C++ Learning Series

Posted 14 June 2015 - 08:53 AM

I have drafts for a tutorial on implementation inheritance using the new C++11 facilities. If it fits any of the above, I'm going to work on it this week ;)
Also, planning to write on polymorphism sometime soon.
Was This Post Helpful? 1
  • +
  • -

#8 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5315
  • View blog
  • Posts: 18,111
  • Joined: 05-May 12

Re: The C/C++ Learning Series

Posted 17 June 2015 - 07:21 PM

I've been staring at those list of topics for the past few weeks and something was bugging me about it.

Originally I thought that what it was that I didn't agree with the old style C++ curriculum of C++ being taught as "C with objects" which the list above seems to follow. I wasn't going to say anything then because I think a majority of the schools outside the first world is still teaching C++ this way. The modern approach does not tackle dynamic memory deeply and data structures that use pointers until later. The modern approach encourages the use of the STL containers first and treat them as blackboxes, much like the way std::string, cin and cout are introduced. It is only later with in depth dynamic memory coverage that you learning how to "roll your own" linked list and binary trees.

Anyway, I finally put my finger on what was bothering me about the list: it doesn't cover basic console and file I/O. One of the common problems that beginning C and C++ programmers run into and get asked in DIC are:
- formatting output
- learning that using gets() is a no-no
- reading input "safely"
- dealing with dangling (carriage returns and/or) line feeds in the input buffer
- string parsing
- error checking
- proper loop construction
- how to use the object error state in C++ in boolean expressions
Was This Post Helpful? 1
  • +
  • -

#9 darek9576  Icon User is offline

  • D.I.C Lover

Reputation: 203
  • View blog
  • Posts: 1,721
  • Joined: 13-March 10

Re: The C/C++ Learning Series

Posted 18 June 2015 - 02:02 AM

Are smart pointers going to be covered in the same place as pointers? Or maybe there should be a separate section for smart pointers in Advanced section. I would also add rvalue references and move semantics to the list.

This post has been edited by darek9576: 18 June 2015 - 02:15 AM

Was This Post Helpful? 1
  • +
  • -

#10 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 387
  • View blog
  • Posts: 1,662
  • Joined: 16-May 09

Re: The C/C++ Learning Series

Posted 18 June 2015 - 09:13 AM

View Postdarek9576, on 18 June 2015 - 01:32 PM, said:

Are smart pointers going to be covered in the same place as pointers? Or maybe there should be a separate section for smart pointers in Advanced section. I would also add rvalue references and move semantics to the list.

Definitely, these two topics are very important. +1 for mentioning them!

Skydiver said:

Anyway, I finally put my finger on what was bothering me about the list: it doesn't cover basic console and file I/O. One of the common problems that beginning C and C++ programmers run into and get asked in DIC are:
- formatting output
- learning that using gets() is a no-no
- reading input "safely"
- dealing with dangling (carriage returns and/or) line feeds in the input buffer
- string parsing
- error checking
- proper loop construction
- how to use the object error state in C++ in boolean expressions

Totally agree with your list. A brief look at the amount of questions/problems with using while(!file.eof()) vs. while(getline(std::cin, line)) or similar approaches shows that many people have problems in this area. There are a couple very good tutorials here at DIC (to name one that I have referenced the most). There is definitely need for more tutorials of this kind.
Was This Post Helpful? 0
  • +
  • -

#11 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 387
  • View blog
  • Posts: 1,662
  • Joined: 16-May 09

Re: The C/C++ Learning Series

Posted 23 June 2015 - 02:02 PM

View PostAnarion, on 14 June 2015 - 08:23 PM, said:

I have drafts for a tutorial on implementation inheritance using the new C++11 facilities. If it fits any of the above, I'm going to work on it this week ;)/>
Also, planning to write on polymorphism sometime soon.

Well, I'm getting old :whistling: Forgot to mention that I have already published the first part of implementation inheritance tutorial (here). There is a second part which involves using templates. Also, there is another one under work on Polymorphism/Virtual Functions.
Was This Post Helpful? 0
  • +
  • -

#12 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1188
  • View blog
  • Posts: 3,568
  • Joined: 20-March 10

Re: The C/C++ Learning Series

Posted 30 June 2015 - 06:51 PM

I have a few questions about the C and C++ chat programs

since sockets are implemented differently on windows and *nix OS's

it would be beneficial to use a socket library that is cross platform then you can simply use one code to rule them all !

For C++ I would recommend Boost.asio

and For C the Netscape Portable Runtime

since both these library's are not straight forward to build and install, especially under windows

I would suggest a Tutorial on how to get , build and install these libs for windows and *nix be included in your list before you try to go building client and server chat programs.

Best Wishes

Snoopy.
Was This Post Helpful? 0
  • +
  • -

#13 AnthonyMcqueen21  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 63
  • Joined: 04-July 15

Re: The C/C++ Learning Series

Posted 07 July 2015 - 03:13 PM

Learning C++ takes time i recommend obviously getting Bjarne Struostrups 4th edition series and learning from sites like

Cplusplus.com
C programming.com

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1