|
Both codes will work...
Raven_Writer's code requires two passed parameters at invocation... argc (an integer) and argv(a pointer to an array of characters (also known as a string)). However, neither is used by the function "main".
monsieurcoffee's code is more traditional and correct as a stand alone program. However, he needs to indent his code so that it is more readable... Without indenting, any non-trivial code is very hard to maintain.
Both Matt and djcapelis are correct but (IMHO) Matt's mindset is more correct for this project... C is a subset of C++, however, using C++ for the PIC processor (if you could) would be like hanging a picture with a sledgehammer. It can be done if you are very careful but, chances are, you will hit your thumb a few times quite unnecessarily.
Code for the robot should be simple and elegant with static variable structures. There is absolutely no need for C++ and all the excess baggage it brings with it.
__________________
Mike Betts
Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013
As easy as 355/113...
|