Language Selection

English French German Italian Portuguese Spanish

An Explanation of Pointers (C++)

Filed under
HowTos

Pointers are basically the same as any other variable. However, what is different about them is that instead of containing actual data, they contain a pointer to the memory location where information can be found. This is a very important concept, and many programs and ideas rely on pointers as the basis of their design, linked lists for example.

Getting Started

How do I define a pointer? Well, the same as any other variable, except you add an asterisk before its name.

So, for example, the following code creates two pointers, both of which point to an integer:

int* pNumberOne;
int* pNumberTwo;

Notice the 'p' prefix in front of the two variable names?

Full Story.

More in Tux Machines

Voyager 9 Linux Distro Enters Development, Now Based on Debian 9 "Stretch"

The developers of the Voyager Linux OS announced the availability of the first Beta build of the upcoming Voyager 9 release, which will be based on the soon-to-be-announced Debian GNU/Linux 9 "Stretch" operating system. Read more

Black Lab Linux Gets First Weekly ISOs, Adds Linux Kernel 4.8 from Ubuntu 16.10

Earlier this week, we told you that Black Lab Software, the developers of the Ubuntu-based Black Lab Linux distribution, published the roadmap of the next Black Lab Linux releases. Read more

Games for GNU/Linux

Linux 4.9.13

I'm announcing the release of the 4.9.13 kernel. All users of the 4.9 kernel series must upgrade. The updated 4.9.y git tree can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y and can be browsed at the normal kernel.org git web browser: http://git.kernel.org/?p=linux/kernel/git/stable/linux-st... Read more Also: Linux 4.4.52 Linux 4.10.1