You can also write C programs with the WPI Robotics Library using a set of C functions that map on top of the C++ classes and methods. To write C code: • You need to create .cpp (C++ files) rather than .C files because the C wrapper functions take advantage of overloaded functions. This means that there are a number of functions that have the same name, but different argument lists. This increases the compatibility with the C++ programming interfaces and will make transition to C++ much easier if you choose to do that. • Specify port and/or slot (module) numbers in most of the functions. Behind the scenes, the functions allocate C++ objects that correspond to the functions that you are using. This serves two purposes: it ensures that you are not using a particular port for two purposes accidently since the C++ underlying functions track “reservations” and makes the code very similar to previous years where the port numbers were on each call. You will find that there...
Learn C++ Programming fast and easy, find C++ Program Codes