Is there a good way around this problem or have I just got to bite the bullet and decide on one or other of the above and go with it? I am really a C++ developer, but with some C experience.
Really, any coding style should make the code easier to read, and easier to maintain - this includes documentation. I normally follow these rules for using globals and structures: Only use globals if absolutely necessary (always try to pass data as arguments to functions, either as values or pointers) If a variable is required to remain in scope for multiple calls to a function, rather than make it global, make it static in the function that's using it. Use structures to group related items together. So a structure containing say screen attributes would be OK, but just grouping variables together for the sake of it would not be acceptable. Also, for documentation, have you tried using Doxygen. I find it does a good job of documentating the code. Stuart. -- --------------------------------------- Stuart Bailey BSc (hons) CEng CITP MBCS LinuSoft (Proprietor) Linux Specialist (01953) 601294 (07778) 383739 http://www.linusoft.co.uk ---------------------------------------- ********************************************************************** This email and any files transmitted with it are confidential. If you are not the intended recipient, please email postmaster@linusoft.co.uk immediately. You should not copy or use this email or attachments for any purpose nor disclose their contents to any other person. NO BINDING CONTRACT WILL RESULT FROM THIS E-MAIL UNTIL SUCH TIME AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF LinuSoft. LinuSoft cannot accept any responsibility for the completeness or accuracy of this message as it has been transmitted over public networks. *************************************************************************