Jeff Cogswell

Jeff Cogswell has been an application developer and trainer for 18 years, working with clients from startups to Fortune 500 companies. He has developed courses on C++ and other technologies.

Articles & Books From Jeff Cogswell

Step by Step / Updated 06-27-2016
Creating a library project in C++ is only a little different than creating a console application. The following steps describe how to create a library project:Choose File→New→Project.You see the New From Template dialog box shown. Highlight the Static Library icon on the Projects tab, then click Go.You see the Welcome page of the Static Library wizard.
Step by Step / Updated 06-27-2016
The static library starts with a standard C file. To make this library work well with templates, you need to delete the C file, add a C++ file, and add a header file. The following steps describe how to perform this process:Right-click main.c in the Projects tab of the Management window and choose Remove File From Project from the context menu that appears.
Step by Step / Updated 06-27-2016
Most of the Boost library works just fine by adding headers to your application code. However, a few components, such as RegEx, require a library. Before you can use a library, you must build it. After you build the library, you must add it to your application.There are two techniques for adding the required headers and libraries to an application.
Article / Updated 03-26-2016
Click here to download the code example files for C++ All-in-One For Dummies, 3rd Edition. These files contain all the sample code from the book. Use them to work through all the C++ sample applications describe in our book. During the writing of this book, a few of our beta readers reported some odd behavior from their anti-virus programs.
Article / Updated 03-26-2016
Remembering a bunch of C++ syntax can make you "loopy." The following samples show the syntax of some of the more easily forgotten C++ situations: a for loop, a while loop, and a switch statement; a class and the code for a member function; a base class and a derived class; a function, function pointer type, and pointer to the function; and a class template and then a class based on the template.
Article / Updated 03-26-2016
In C++, a header file holds forward declarations of identifiers. Here are some of the most common C++ header files that you’ll be using, along with their correct spellings. These aren’t by any means all of them, but they are the most common: Include if you’re going to be using the string class. Include when you want to use cout and cin.
Article / Updated 03-26-2016
Although many C++ programmers take measures to prevent bugs, mistakes still slip through. This list of the ten most common mistakes while writing C++ code can help both new and veteran programmers: You forgot to declare the variable. You used the wrong uppercase and lowercase letters; for example, you typed Main when you meant main.
Article / Updated 03-26-2016
Many C++ newbies want to create the projects they find in books by typing in the code they come across to better see how the process works. However, sometimes just getting the project started can be a serious problem. You may find step-by-step instructions online that provide you with techniques you can use to create the projects, but often, these procedures build on what you've done before.
Article / Updated 03-26-2016
Static arrays are allocated on the stack, which can limit their usability. Dynamic arrays are allocated on the heap, which means they're only limited by the size of memory. Admittedly, you'll find a few other differences between dynamic and static arrays, but the bottom line here is that, although dynamic arrays require a little more work to use because you must manage the memory yourself, they also provide added flexibility in working with data.
Article / Updated 03-26-2016
A map provides a method for quickly working with lists of data in such a manner that you can access each element easily with a key. Using a map is convenient because you can access the items in a random order. However, every key must be unique. It’s not as if your application will fail if you assign a value to a duplicate key — the duplicate will simply overwrite the original value.