I've been working/coding in C#/Java for some years, so the basics etc. don't give me to much a hard time. But I've never done anything larger than small commandline learning programs in c.
Now I'm trying to make a mobile phone emulator for Linux and I have no clue how to structure my code when its not object oriented. I have 3 big books that cover c in detail but none of them cover how to code for maintainability in a bigger project.
So i was hoping some of you more experienced people could point me to a best practice or similar?
A declaration part and an Execution part. The declaration part is the part where all the variables are declared. The execution part begins with the curly brackets and ends with the curly close bracket. Both the declaration and execution part are inside the curly braces.
The procedural or linear structure of a program is defined by its control flow. More formally, the procedural structure is built from blocks of code, where each block or unit has a single entry and a single exit point in the control flow.
Some thoughts (and this question should be a community wiki)
static
functions where you'd otherwise use private
methods.static
keyword, as well as give you a good indication when it's time to split off some functionality into a seperate file. For a Java programmer, this shouldn't be too strange a practice.structure it generally the same way. Separate things into several files, each containing code which do related work.
Often with C, you can still think about objects. But instead of classes with methods, they are structures and functions which operate on a struct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With