Yes. "extern int u;" in f2.c.
Printable View
Yes. "extern int u;" in f2.c.
yes, I know. I put that there to show that you needed to declare it with an extern in the file.
A dos prompt! Ewww!
But as I said, I'm not an expert on the matter, so...
I don't know! Go bug someone else! :p
That's untrue. It works the same as in C. You have to declare it as "extern" in the other modules that reference it.
Have you EVER worked on code composed of more than a single source file?Quote:
Internal linkage in C. Cannot be accessed from other .c files.Code:static int x = 5;
I don't know what the effect is in C++, though. I don't know if it will cause external linkage in this case.
YES, I have. Hundreds of times.