Category Archives: C++ Programming

Installing and Accessing Shared Libraries

Following on from last week, you should have been able to build your own .so library file and link to it with a separate executable. This week we’ll look at installing the shared library (see last week for the source files. This weeks commands follow on from there). Basically we have three options when it […]

Creating a Shared Library

I thought we could take a quick look at how to create a shared library out of our code. This week we’ll create the library and next week we’ll look at the various ways of installing/accessing it on the operating system. I’m going to re-use the palindrome program I’ve talked about before (a proper version, not the dodgy […]

A Challenge Discussion – Returning Pointers To Local Variables

Last week’s challenge was a tough one, so don’t be alarmed if you had no idea what the issue might have been. Also, it can be hard to spot problems in a functional program because you tend to concentrate on what the code is actually doing, rather than the validity of the code itself. To give […]

A Challenge

I have a challenge for you. Is there a problem with this code? It compiles without warnings, and runs as expected. I’ll reveal all next week. Have fun! g++ -g -Wall palindrome_problem.cpp #include <iostream> #include <string.h> using namespace std; char* isPalindrome(char* word) { char* ret = 0; ret = (char*)”Yes! This is a palindrome.”; char […]