This is a list of frequently asked questions here on CodeCall. If you have suggestions, corrections, new questions or answers to the list, or anything else, please send a PM to me.
The list does not need to be read from top to bottom, so you can easily jump to the question you're searching for without reading the previous questions. Use your browser's search functionalities to search for specific keywords.
Each question will be in bold text, and beneath the question there'll be some text with italics. This text in italics is a list of contributors to the current question. If you want to get your name in this text as well, you can send me a PM with whatever corrections you think it needs, like I also stated above. And at last, all the normal text beneath texts in bold and italics is the actual answer. Important keywords are marked, again, with italics. Bold text may also occur in lists.
How do I get started programming in C or C++?
(Contributors: v0id -- Last update: July 25th, 2008)
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. The compiling process is where the sourcecode is translated into the Assembly programming language by a compiler. The assembling process is where the new Assembly code is translated into machine code by an assembler. The last process, the linking process, is where external libraries are linked onto or included in the program, depending on if it's a dynamic or static library, using a linker.
Other important tools for C/C++ programmers include profilers, debuggers, and editors (maybe even IDEs and RADs).
Which compiler shall I use?
(Contributors: v0id -- Last update: July 25th, 2008)
Choosing a compiler can be hard as there's many of them, and it seems like they all do the same. That's not all true. It's true that there's many compilers, but it's not true that they all do exactly the same. Some compilers do support both C and C++, some do not; some follows the standards, some do not; some has extra functionality besides the standards, some have not; some are fast, some are not; some are free, some are not; and so it goes.
This is an incomplete list of compilers:
- GCC (C/C++; Cross-platform; Free; Open-source)
- MinGW (C/C++; Windows; Free; Open-source)
- Cygwin (C/C++; Windows; Free; Open-source)
- Portable C Compiler (C; *nix; Free; Open-source)
- Amsterdam Compiler Kit (C; Minix/*nix; Free; Open-source)
- DJGPP (C/C++; DOS/Windows; Free; Open-source)
- Watcom C/C++ Compiler (C/C++; DOS; Free; Open-source)
- Tiny C Compiler (C; Windows/*nix; Free; Open-source)
- Intel C++ Compiler (C/C++; Windows/Linux/Mac OS X; Non-free; Closed-source)
- Digital Mars C++ (C/C++; DOS/Windows; Free; Closed-source)
- Visual C++ (C/C++; Windows; Free; Closed-source)
- Comeau C/C++ (C/C++; Windows/*nix; Non-free; Closed-source)
- TenDRA Compiler (C/C++; POSIX; Free; Open-source)
Which assembler shall I use?
(Contributors: v0id, MeTh0Dz|Reb0rn -- Last update: July 25th, 2008)
Choosing an assembler can be hard as there's many of them, and it seems like they all do the same. That's not all true. It's true that there's many assemblers, but it's not true that they all do exactly the same. Some assemblers do use Intel syntax, some do not; some are fast, some are not; some are free, some are not; and so it goes.
Most compilers (or rather, compiler packages) include an assembler as default, so one does usually not need to pick an assembler oneself.
This is an incomplete list of assemblers:
- A(3)86 (Intel syntax; DOS/Windows; Free; Closed-source)
- FASM (Intel syntax; DOS/Windows/*nix; Free; Open-source)
- GAS (AT&T syntax; Cross-platform; Free; Open-source)
- HLA (Own syntax; Windows/*nix/Mac OS X; Free; Closed-source)
- NASM (Intel syntax; DOS/Windows/*nix/Mac OS; Free; Open-source)
- YASM (Intel/AT&T syntax; DOS/Windows; Free; Open-source)
- TASM (Intel syntax; DOS/Windows; Non-free; Closed-source)
- MASM (Intel syntax; DOS/Windows; Free; Closed-source)
- MASM32 (Intel syntax; Windows; Free; Closed-source)
Which linker shall I use?
(Contributors: v0id -- Last update: July 25th, 2008)
Choosing a linker can be hard as there's many of them, and it seems like they all do the same. That's not all true. It's true that there's many linkers, but it's not true that they all do exactly the same. Some linkers are fast, some are not; some are free, some are not; and so it goes.
Most compilers or assemblers (or rather, compiler packages or assembler packages) include a linker as default, so one does usually not need to pick a linker oneself.
This is an incomplete list of linkers:
Which profiler shall I use?
(Contributors: v0id -- Last update: July 25th, 2008)
Choosing a profiler can be hard as there's many of them, and it seems like they all do the same. That's not all true. It's true that there's many profilers, but it's not true that they all do exactly the same. Some profilers are fast, some are not; some are free, some are not; some support different kinds of analysis, some do not; and so it goes.
This is an incomplete list of profilers:
- gprof (Cross-platform; Free; Open-source)
Which debugger shall I use?
(Contributors: v0id, MeTh0Dz|Reb0rn -- Last update: July 25th, 2008)
Choosing a debugger can be hard as there's many of them, and it seems like they all do the same. That's not all true. It's true that there's many debuggers, but it's not true that they all do exactly the same. Some debuggers are fast, some are not; some are free, some are not; some support different kinds of analysis, some do not; some have a GUI, some have not; and so it goes.
This is an incomplete list of debuggers:
- GDB (Cross-platform; Free; Open-source)
- OllyDbg (Windows; Free; Closed-source)
- TVD (*nix/Mac OS X; Non-free; Closed-source)
- WinDbg (Windows; Non-free; Closed-source)
- SoftIce (Windows; Non-free, Closed-source)
- KGDB (Linux; Free; Open-source)
Which IDE (Integrated Development Editor) shall I use?
(Contributors: v0id, MeTh0Dz|Reb0rn, WingedPanther -- Last update: July 26th, 2008)
Choosing an IDE can be hard as there's many of them, and it seems like they all do the same. That's not all true. It's true that there's many IDEs, but it's not true that they all do exactly the same. Some IDEs are fast, some are not; some are free, some are not; some have syntax highlighting, some have not; and so it goes.
This is an incomplete list of IDEs:
- Visual C++ (Own compiler; Windows; Free; Closed-source)
- Dev-C++ (Optional; Windows; Free; Open-source)
- Code::Blocks (Optional; Cross-platform; Free; Open-source)
- Quincy 2005 (Optional; Windows; Free; Open-source)
Which RAD (Rapid Application Development) shall I use?
(Contributors: v0id -- Last update: July 25th, 2008)
Choosing a RAD can be hard as there's many of them, and it seems like they all do the same. That's not all true. It's true that there's many RADs, but it's not true that they all do exactly the same. Some RADs are fast, some are not; some are free, some are not; some have syntax highlighting, some have not; and so it goes.
This is an incomplete list of RADs:
- wxDev-C++ (wxWidgets; Windows; Free; Open-source)
Do I need other tools than compilers, assemblers, linkers, etc.?
(Contributors: v0id, MeTh0Dz|Reb0rn -- Last update: July 25th, 2008)
Besides all these basic tools, there's other more specialized tools for the C/C++ programmers, for various purposes. These will be listed here, as they don't really fit in anywhere else. If you don't know what they're good for, and don't understand the short description, then you don't have to care about these - they're really only for specialized tasks.
This is an incomplete list of miscellaneous tools:
- DrvInst (Driver insertion; Windows; Non-free; Closed-source)
I want to try out some libraries, what are some of the most known?
(Contributors: v0id, MeTh0Dz|Reb0rn, WingedPanther -- Last update: July 26th, 2008)
There's tons of libraries for C and C++. This is a collection of some of the major and mature ones.
This is an incomplete list of major libraries:
- wxWidgets (GUI; Cross-platform; Free; Open-source)
- GTK+ (GUI; Cross-platform; Free; Open-source)
- FLTK (GUI; Cross-platform; Free; Open-source)
- Qt (GUI; Cross-platform; Free; Open-source)
- JUCE (GUI, Media; Cross-platform; Free; Open-source)
- WinPcap (Networking; Windows; Free; Closed-source)
- Boost++ (General-purpose; Cross-platform; Free; Open-source)
Where can I find information about particular functions?
(Contributors: v0id -- Last update: July 25th, 2008)
There's many places around on the internet where you are able to find information about particular functions. Some operating systems do even allow you to check functionality for functions, like Linux and its man-pages (if the man-pages are installed for the functions, of course).
This is an incomplete list of references for standard C/C++ functions:
- Cplusplus.com (both for C and C++)
- Cppreference.com (both for C and C++)
If you're looking for specific functions which are parts of libraries, or similar, you'll need to use the manuals or references for the given library.
This is an incomplete list of references and manuals for different libraries:
Static- and dynamic libraries?
(Contributors: v0id -- Last update: July 25th, 2008)
When you're using external libraries or creating one yourself, you must choose whether it shall be a static- or a dynamic library. It does matter which one you pick, as they work differently when they get attached to your program.
A static library becomes a part of your program; literally a part. So when you link your program with a static library all the functionality will go right into your program. A dynamic library will not become a part of your program. It will stay as an external part, but your program can use its functionality through the linking. A disadvantage of dynamic libraries is that the user may loose the dynamic library. Without the dynamic library the program will not be able to work. There's also both dis- and advantages of static libraries. The disadvantage is that the executable file will increase in size, as the static library will become a part of it. The advantage is that the user can not loose the library, as it's not an external file.
My sourcecode won't compile, what do I do?
(Contributors: v0id, WingedPanther -- Last update: July 26th, 2008)
This question is not as straightforward as it may sound. The problem can be caused by multiple things. The two things that it most likely to be is either an error in your sourcecode, or problems with your programming environment. Many people do not realize that the problem may be located in their programming environment. So, if you're not getting any error-messages from your compiler, or if it's all silent, it's about time to look into your environment.
This also mean that your problem no longer is a general programming language; now the problem lies in your programming environment. So instead of making a question on C/C++, you shall make a question in a more general forum, or better go to the forum of the particular environment, as they're most likely better to help you out.
If, on the other side, it was just an error in your code you shall read the message you get, and if you don't understand it, create a thread in our forum, and we'll be happy to help you out.
What does this and that mean?
(Contributors: v0id -- Last update: July 25th, 2008)
This is an incomplete list of the many terms in the world of C and C++:
- Assembler: A tool that translate a given Assembly code into machine code.
- CLI: Command Line Interface. On Windows the commandline, on *nix and Mac OS X, the terminal.
- Compiler: A tool that translate a given C or C++ code into the Assembly programming language.
- GUI: Graphical User Interface. A user interface for the user which consists of graphical components.
- IDE: Integrated Development Editor. A specialized editor which automatically compile the C or C++ code.
- Linker: A tool that links external libraries to your program.
- RAD: Rapid Application Development. A specialized editor where you can design a GUI, like in a normal application for graphics, like Photoshop or GIMP.
- Sourcecode: The actual C or C++ code, later to be compiled.
- TUI: Text User Interface. Like a GUI, but where the graphics are made of characters (sometimes even with colors).
My question is not answered here, what do I do?
(Contributors: v0id -- Last update: July 25th, 2008)
If your question is not answered in this FAQ, you should check out our forum, and see if your question has been asked before. If not, then I suggest you to create a new thread with your question, and our helpful members will do the best they can to answer your question.
You can find our C/C++ forum here:
Another option is to check out some of the other FAQs which can be found around on the internet. There's lots of them, so you'll just have to find the right one.
This is an incomplete list of other C/C++ FAQs:
- C++ FAQ Lite
- Bjarne Stroustrup's FAQ (The creator of C++)
- comp.lang.c FAQ
A last note
This FAQ is not done, in fact it's only a beginning. I will continue to add new questions and answers, so stay tuned!
Last edited by v0id; 07-26-2008 at 12:19 AM.
This was a good idea. I'll PM you some stuff you might one to add on later.
A lot of great information here v0id! Excellent work - +rep!
That sounds brilliant.Originally Posted by MeTh0Dz|Reb0rn
Thank you alot. It took me quite some time to create the different lists.Originally Posted by Jordan
I updated the FAQ so that contributors will be credited for their questions and answers, corrections, suggestions, etc.
Last edited by v0id; 07-25-2008 at 07:42 AM.
Boost++ library is another resource of value.
Dev-C++ is open-source, not closed-source.
Often, the choice of debugger/linker is driven by the choice of compiler, as many are distributed as a "bundle".
It is also important for people asking questions to realize that a "C++ question" may actually be specific to the IDE/Compiler/Environment they are using, which may result in it being a question that addresses a specialty fewer users can help with.
Thanks.Originally Posted by WingedPanther
Thanks, again.Originally Posted by WingedPanther
I already pointed this out under "Which assembler shall I use?" and "Which linker shall I use?" For the debugger, I have seen many compiler packages which aren't coming with debuggers, so I haven't wrote it for the debuggers. I should however probably change package => bundle. I just couldn't remember the right word at the time of writing.Originally Posted by WingedPanther
Good idea.Originally Posted by WingedPanther
I would like if you could send me a PM next time. I want the posts in this threads just to be comments and requests, if somebody need something. But thanks again, and you'll be credited where you've contributed.
I've split this thread into two threads, a C/C++ resources thread and a C/C++ frequently asked questions.
The C/C++ resources can be found here,
and the C/C++ frequently asked questions can be found here.
This thread has been closed, but not deleted. In that way the information given in this thread is still accessible; it will however might be deleted in the future, but for now it won't.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks