Is it possible to create a "Motor" object in PROS?

Seeing PROS does not have a pragma like RobotC, I thought it’ll be a good idea to make a class called motor. Here, information stored would be the port number, a function that takes in an int and sets that the speed, etc. However, is this possible? I’m pretty sure PROS is an extension of C for VEX robotics. And if it’s possible, where and how would I implement it? Would I create a header file to hold the class and a source file to create all of the objects? Thank you in advance.

So C is the only supported Language of PROS currently. C does not support classes or object oriented programming.

https://vexforum.com/t/new-and-delete-keywords-pros/42240/1
Apparently there is, but you’d have to do some stuff I don’t understand

But I want to stick with the ‘default’ PROS. I’m sure there is some way to get the same effect in C

In the ‘main.h’ header file, you’ll see some lines like so:

#ifdef __cplusplus
extern "C" {
#endif

and at the end of the file

#ifdef __cplusplus
}
#endif

If you want classes in your PROS project, you need to write it in C++. Add those lines to all of your header files (it may not be necessary in all of them, but better to be safe than sorry), the first section to the top and the second to the bottom. When you create new files, make them [file].cpp instead of [file].c and make sure to rename opcontrol.c, autonomous.c, and init.c with .cpp endings. You can now use full C++ in your PROS project, without any external libraries or anything. For some examples on how to declare and define classes, see include/motor.h and src/lib/motor.cpp in my competition code here.

okapilib is a great community contribution which adds C++ support. You can read their started guide here.