![]() |
Legal to add .c file?
Would it be legal to add a .c file to the code which contains functions that could be called by the autonomous AND user routines?
|
Re: Legal to add .c file?
Yes it is perfectly legal to do so.
|
Re: Legal to add .c file?
Quote:
|
Re: Legal to add .c file?
...yes, it should work just fine. We do it all the time.
On a side note: For good programming practice, you'll want to put the function prototypes of your functions into a .h file of the same name. Then #include the .h file at the top of the other files that you want to use the functions in. |
Re: Legal to add .c file?
Absolutely. Basically, you can do anyhting you want as far as code is concerned. There is nothing that is restricted. The hardware is designed such that there is no way you can screw up code in a way that would cause the E-Stop, team numbers etc to stop working.
|
Re: Legal to add .c file?
In fact, (although not the best of programming practices) you can just create an .h file called "include.h," and put all of your other includes in it, and then just include "include.h" in your c files.
The drawback is that every file includes every header, which may not always be desirable, HOWEVER, for beginning programmers, this can simplify the process of "which files do I need to include?" |
Re: Legal to add .c file?
Quote:
|
Re: Legal to add .c file?
Alright, thanks a lot. :)
|
Re: Legal to add .c file?
It depends on the scope of your program. while I would never use it in a major project, the smaller PIC programs lend themselves to centralizaiton of some things, and it can really simplify the process.
|
| All times are GMT -5. The time now is 18:26. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi