Please Help with Encoder in C++!

We are trying to control the speed of a motor on our shooter mechanism with an encoder. We have researched up and down and still can’t seem to find any simplified advice. We just switched from Lab View to C++ this year and we are all still learning. Does anyone have some sample code and/or an explanation of how to incorporate an encoder into a Command Based C++ program? Thank you!
-Alicia of Team 3197

Here is our starting PID control system for our shooter. It has two wheels, with an encoder on each wheel. The encoder resolution is 256 ticks per revolution. This loop needs to be tuned (changing the P, I, and D constants), but it is functional starting code.