This thread is meant as another FAQ which is specialized in this forum, the C/C++ forum in particular. If you read this before creating a thread or a post you may avoid asking already frequently asked questions.
I want to learn C/C++, what do I do?
Both C and C++ are so-called compiled languages. That means that programs written in C or C++ will be translated directly into machine code, which can be read directly by your operating system. This translation consists of three steps: compiling, assembling and linking.
compiling process is where the source code is translated in to the assembly language by a compiler. This assembly language can then consist of commands specific to the target processor and architecture.
assembling process is where the new assembly code is translated in to machine code by an assembler. This code is stripped of most data that is not required to run the program (comments, notes, formatting) and is formed as a string of bytes, each byte representing part of, one, or more than one command for the target processor.
linking process is where external libraries are linked in to or included in the program, depending on if it's a dynamic or static library, using a linker. This results in an executable wrapper that the host operating system can initiate the assembled machine code with or a means for another executable to use its functionality by function name rather than byte sequence.
Which tools? tool chains? do I need debuggers?
There are many tools for every C/C++ programmer, and some that can greatly aid in application development. These tools are usually more specialized in specific tasks, such as a profiler for optimization where function calls are logged in real time, a debugger to find memory or application state issues for debugging, or an IDE (integrated development environment) for graphical management of source code and a front-end to compiling processes in one package.
Each one of these are not critical to programming in C, however can be invaluable and worth the effort to learn when you are programming a serious application.
There must be something more than online tutorials.. am I just stuck?
When you have the tools you need to learn the language, such as a compiler toolchain containing all that is necessary to compile, assemble and link, you will need to choose a path of learning.
This can be done in multiple ways. One can learn a lot directly from the internet and the programs on it (such as on SourceForge), and this knowledge can be incorporated in to your own programming, if you understand how it works. If you do not mind investing some money, or need in-depth information and references, a well thought choice is to get your hands on a programming book. Well-reviewed books are often the most appropriate learning material for serious students of programming and build correct coding habits.
Another ambitious choice is to join a programming class or course, either online or at a local institution. In this method you will be able to get feedback and support in a personalised manner, have a structured environment instead of jumping from page to page online, and try out new learning methods in a positive class environment.
Teachers of programming often wind their way on forums such as this too, and so advise found can be a good supplement to a well structured class.
How do I make a driver? ...
... and other questions alike can be impossible for us to answer directly if you are not providing some information about your (operating) system. You must always keep in mind that all systems are different in some manner to a level which may not be apparent to you, and the same code may not work on all systems nor may some suggestions.
This goes for many other so-called platform-dependent questions. If you are not sure whether it's a platform-dependent question, then give us the information you think is necessary (mingw instead of gcc for example, visual studio on a 64 bit system when working with pointers, ...) You are on the secure side, and you do not have to worry about whether users know what you are talking about and do not have to guess giving blanket suggestions.
The search feature is an important too. There are multiple "How do I create an operating system?" threads for example which can be found. Our site strives to index content in a searchable manner with tagging, and is to be used for your benefit.
Is it okay to use conio.h, linux.h or similar? ...
... and questions alike regarding platform-dependent libraries are not really questions for us, but more for yourself. You must consider whether you will use a platform-dependent library or not. The advantage of platform-dependent libraries is that it may have more specialized functionality for your system, or environment, than a platform-independent library, and thus will you have more possibilities. The disadvantage is obviously that platform-dependent libraries do only run on the system or environment it was designed for, so it may not run on other systems. You should especially keep this in mind if you are thinking about making commercial applications.
There is no reason to stop yourself from programming when you find yourself using platform dependent calls, as long as you understand the scope of your project and how you can use alternatives if you are faced with such a situation where you are not able to use them.
Is this tool better than that tool?
This is mostly a matter of taste. Different people prefer different tools. Maybe because it is faster, maybe because it's easier to use, maybe because it looks good, you will see a lot of varying opinions online. If you are asking such a broad question you will end up in the situation similar to researching the tools yourself.
Investigating and collecting information about different tools is a more rewarding solution in that you learn how to use different tools and find out whether they fit your ability and you or not. If you finally end up with two or maybe three tools, and cannot choose, then it is easier to ask for a specific recommendation or experience another user has had based on your specific needs rather than something very general.
The programmer learns to pick up and drop many things during their career.
Is C too old?
You may find people recommending to stay away from C, however it still remains a fundamental language for system programming and can teach you invaluable insights in to how memory management and security come in to play.
C code maps directly in to machine instructions for almost every processor or microcontroller architecture, and can produce minimal and efficient code without the need of existing software to run it. C is a great alternative to coding directly in assembly, however does not provide the programmer with modern tools such as object oriented programming or handled memory on strings or object allocations.
Are the languages being updated at all?
C and C++ as languages are not set in stone, new revisions to provide modernisation are coming by committee or from necessity. Great time will be involved in finalising and integrating the language in to the programming culture or businesses, however looking in to future revisions of standards is important.
Recent standards are given in the form of C(++)(revision by year) and may have incremented after the time of this post.
Wikipedia link: http://en.wikipedia....ndard_revision)
What standards do we use now for C?
Usually: C99 (1999)
C++11 (formerly C++0x, for 200x) (2011):
Wikipedia link: http://en.wikipedia.org/wiki/C%2B%2B11
What standards do we use now for C++?
Usually: C++98 or C++03 (1998, 2003)
Some historical versions which should be known to you for use in spotting old code:
ANSI/ISO C: http://en.wikipedia....NSI_C_and_ISO_C
(Note: ANSI and ISO C are outdated C89 (1989) era standards)
You can find a list of tools, books, websites, and other general resources for C/C++ in the C/C++ resource thread.
Edited by Alexander, 30 July 2012 - 11:34 PM.
(cleanup of broken censor remnants)