Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/02/04 14:24
Read: times


 
#61739 - RE: Whats wrong with good ol pointer/global?
Responding to: ???'s previous message
In processing of serial protocols the string parsers and error checkers can get pretty long. To move out a block of code to another function,"inheriting" the variables is handy. In this case it means parameters by reference. Of course one cannot still overcome the limit of the stack during calls, so deep nesting can still be a problem.
A pointer by itself is useless, it also needs to point to a variable so a variable must also exist. That makes the pointer an unnecessary overhead, if I can have "by reference".
Global variables tie up the memory permanently, so we avoid them.
In the long run even if I am the only programmer of the project, too many global variables make the code difficult to maintain.

List of 21 messages in thread
TopicAuthorDate
OT: C parameter by reference or by value            01/01/70 00:00      
   RE: OT: C parameter by reference or by value            01/01/70 00:00      
      Parameters on stack            01/01/70 00:00      
      RE: OT: C parameter by reference or by value            01/01/70 00:00      
   Whats wrong with good ol pointer/global?            01/01/70 00:00      
      RE: Whats wrong with good ol pointer/global?            01/01/70 00:00      
         RE: Whats wrong with good ol pointer/global?            01/01/70 00:00      
            RE: Whats wrong with good ol pointer/global?            01/01/70 00:00      
               RE: Whats wrong with good ol pointer/global?            01/01/70 00:00      
            Pointer vs Reference            01/01/70 00:00      
               RE: Pointer vs Reference            01/01/70 00:00      
                  RE: Pointer vs Reference            01/01/70 00:00      
                     RE: Pointer vs Reference            01/01/70 00:00      
         RE: Whats wrong with good ol pointer/global?            01/01/70 00:00      
         RE: Whats wrong with good ol pointer/global?            01/01/70 00:00      
            RE: recursive functions            01/01/70 00:00      
   RE: OT: C parameter by reference or by v            01/01/70 00:00      
      RE: OT: C parameter by reference or by v            01/01/70 00:00      
      RE: OT: C parameter by reference or by v            01/01/70 00:00      
         RE: OT: more useful to have explicit ..            01/01/70 00:00      
         RE: OT: C parameter by reference or by v            01/01/70 00:00      

Back to Subject List