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

Evolve OS Is a Superb New OS Built from Scratch, First Beta Is Out – Gallery

Evolve OS, a new Linux distribution built from scratch that's using a fresh desktop environment called Budgie, has been upgraded to version Beta 1 and is now ready for testing. Read more

Nouveau In Linux 3.20 Will Have A Lot Of Code Cleaning

While the Nouveau pull request has yet to be issued for the DRM-Next merge window that will ultimately target the Linux 3.20 kernel, a look at the changes so far appear to mostly indicate this open-source NVIDIA driver is just going through a period of code cleaning and reorganization. Read more Also: Linux kernels for a macbook pro retina

Android Leftovers

Debian 8.0 "Jessie" Installer RC1 Released

The first release candidate for the Debian Jessie Installer in leading up to the Debian 8.0 "Jessie" release. While some Debian developers were hoping to release Debian 8.0 before February, it doesn't look like that will pan out given that the first release candidate of the installer surfaced today. Read more Also: Debian 8.0 "Jessie" RC1 Is Here, Test Away