Raised This Month: $ Target: $400
 0% 

When to use global variables?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 11-07-2006 , 19:16   When to use global variables?
Reply With Quote #1

Doesn't global variables take up a lot more memory then local ones to?
For example:
Code:
#include <amxmodx> #include <amxmisc> #define MAX_LIMIT 100 new gMax_limit  = MAX_LIMIT public plugin_init() {      register_plugin("Somthing","Something","Sure") } public a_function(id) {      client_print(id,print_chat,"Max limit is: %i", gMax_limit) }

Would it be better to register the variable in the function 'a_function' ?
Drak is offline
Send a message via MSN to Drak
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode