Post Reply 
forward declaration of variables?
10-12-2015, 04:12 AM
Post: #2
RE: forward declaration of variables?
(10-12-2015 01:28 AM)ji3m Wrote:  So to connect functions between files we use the forward declaration

myfun (); if my fun is in another file. This is good.

But this doesnt work with variables or pseudo constants

If myvar was in another file and we use it here, just hope the other was compiled first.

the declaration myvar; produces a new local to the current file.

This is wrong.

it should work the same way. If a local is desired it should be declared as
local myvar;

So the upshot is if variables are to be shared between files they better all be declared in
a file that is compiled before everyone else or an endless stream of errors occurs.

It seems like ppl is uninventing well understood rules of scope.

Here's how I understand the scope:

http://www.hpmuseum.org/forum/thread-215.html

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
forward declaration of variables? - ji3m - 10-12-2015, 01:28 AM
RE: forward declaration of variables? - Han - 10-12-2015 04:12 AM



User(s) browsing this thread: 1 Guest(s)