An Explanation of Pointers (C++)

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?
-
- Login or register to post comments
Printer-friendly version
- 652 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
Android/ChromeOS/Google Leftovers
| Games: SC-Controller 0.4.2, Campo Santo, Last Epoch and More
|
Android Leftovers
| Ryzen 7 2700X CPUFreq Scaling Governor Benchmarks On Ubuntu Linux
With this week's Ryzen 5 2600X + Ryzen 7 2700X benchmarks some thought the CPUFreq scaling driver or rather its governors may have been limiting the performance of these Zen+ CPUs, so I ran some additional benchmarks this weekend.
Those launch-day Ryzen 5 2600X / Ryzen 7 2700X Ubuntu Linux benchmarks were using the "performance" governor, but some have alleged that the performance governor may now actually hurt AMD systems... Ondemand, of course, is the default CPUFreq governor on Ubuntu and most other Linux distributions. Some also have said the "schedutil" governor that makes use of the kernel's scheduler utilization data may do better on AMD. So I ran some extra benchmarks while changing between CPUFreq's ondemand (default), performance (normally the best for performance, and what was used in our CPU tests), schedutil (the newest option), and powersave (if you really just care about conserving power).
|
Recent comments
13 hours 32 min ago
14 hours 43 min ago
20 hours 4 min ago
1 day 21 hours ago
3 days 2 hours ago
3 days 2 hours ago
3 days 14 hours ago
3 days 15 hours ago
4 days 10 hours ago
4 days 11 hours ago