After a couple of days of Googling, I've finally given up and need some help from the community.
I'm quite new to C++, and decided I'd start by dissecting this code:
A C++ program to get CPU usage from command line in Linux
For the most part, I can surmise a good bit of it, except how the ampersand is being used in the last line:
const int NUM_CPU_STATES = 10;
typedef struct CPUData {
std::string cpu;
size_t times [NUM_CPU_STATES];
} CPUData;
std::vector<CPUData> entries1;
const CPUData & e1 = entries[$i]
The closest I can gather is that its a Bitmask or Bitwise operator. But either way, I can't make sense of how its used in this context.
EDIT: Thanks for the quick replies! I understand now that this is creating a reference. What kept me from picking up on it was the spacing, given the nuances of any language I had assumed it had some significant meaning.