Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Global variables in Upp
Re: Global variables in Upp [message #28730 is a reply to message #28729] Tue, 14 September 2010 08:18 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Well yes, point number 1 is well known about C/C++ and has nothing to do with U++. Include guards protect you from multiple declarations, but you must manually make sure that there is only one definition that the linker sees. Variables MUST be defined with extern if you want to spare yourself future problems. This applies to variables in namespaces too. And static variables in classes.

As always, you can come up with clever layouts for your cpp/h files that will work for your case. But I recommend going with one of the standard ways. These are all convention based and deterministic, i.e. after you decided what file includes what item, the same item will always appear in the same file and in the same logical section and there are no questions related to what goes into a h and what into a cpp. There is no thinking involved, just applying the pattern you know Smile.

As for point number 3, the names and the parameter lists are pretty self explanatory until they get documented. Be prepared to do a little exploration work.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Limits check in Meter code
Next Topic: GLCtrl: does it support multisamplig feature?
Goto Forum:
  


Current Time: Thu May 09 12:10:32 CEST 2024

Total time taken to generate the page: 0.01716 seconds