Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Structures in C++ *

Tags:

c++

structure

Probably a dumb question, but I'm just curious. What do the variables *temp and *perm mean in this structure?

struct process {
    int id;
    char name;
} *temp, *perm;
like image 249
Burnie Avatar asked Dec 24 '22 23:12

Burnie


1 Answers

Short version of

struct process {
    int id;
    char name;
};

process *temp;
process *perm;

This declares a struct type named process and then declares two variables which are pointers to process structs.

like image 170
NineBerry Avatar answered Jan 21 '23 06:01

NineBerry