extern static array of structs

Posted By: Smon

extern static array of structs - 01/21/18 06:15

I wrote an indicator which holds data in a static struct array.

It's very complex code so I packed it into a function in an external source file for convenience reasons.

The function returns an index. Now I want to make the array a global variable so that I can just call

Code:
MyArray[Indexfunction(some params)]


from within the trading script.

However, declaring

Code:
extern static STRUCT MyArray[100];



or even

Code:
static extern STRUCT MyArray[100];



results in a syntax error.

Is it even possible what I'm trying to do here?
Posted By: Spirit

Re: extern static array of structs - 01/21/18 17:20

I am pretty sure that lite C has no linker, so "extern" wont work.
Posted By: jcl

Re: extern static array of structs - 01/22/18 09:36

Correct, it has no linker.
Posted By: Smon

Re: extern static array of structs - 01/23/18 19:33

It seems, that I don't need to use "extern", as "static" already makes a variable global. I will give this a try!
Thx!
Posted By: 3dgamelight

Re: extern static array of structs - 01/05/19 07:02

Lite-C have a linker. If not it wouldn't be possible to compile dlls or run Lite-C programs without some program that jumps to the Lite-C code.

"Creating dynamic link libraries 100%"
http://manual.3dgamestudio.net/forecast.htm
© 2024 lite-C Forums