T
Tomás Ó hÉilidhe
I have a translation unit which defines a global object:
BEGIN "yellow.c"
int i = 7;
END
I want this object to be accessible from other translation units, so I give
it external linkage. However I want it to be read-only in other translation
units. I didn't think it was too far-fetch to simply declare it as follows
in a header file:
BEGIN "yellow.h"
extern int const i;
END
Is this definitely not supported by C89? I realise I could write a function
which would return the variable's value, but I thought a solution like
above would be neater.
BEGIN "yellow.c"
int i = 7;
END
I want this object to be accessible from other translation units, so I give
it external linkage. However I want it to be read-only in other translation
units. I didn't think it was too far-fetch to simply declare it as follows
in a header file:
BEGIN "yellow.h"
extern int const i;
END
Is this definitely not supported by C89? I realise I could write a function
which would return the variable's value, but I thought a solution like
above would be neater.