forward declaration of variables?
|
10-12-2015, 01:28 AM
(This post was last modified: 10-12-2015 01:31 AM by ji3m.)
Post: #1
|
|||
|
|||
forward declaration of variables?
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. I work with android Prime only for now on my Galaxy Tab Pro/Note 2 |
|||
« Next Oldest | Next Newest »
|
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
RE: forward declaration of variables? - cyrille de brébisson - 10-12-2015, 05:29 AM
RE: forward declaration of variables? - ji3m - 10-12-2015, 12:59 PM
|
User(s) browsing this thread: 2 Guest(s)