Question about the C static function says there's a static function I wonder why you make a function only available in the same file.
c static
Since the static function is only visible within the same translation unit, Write when you don't want other translation units to know the existence of this function (encapsulation)
helper_file.c:
int f1(int); /* prototype */
static int f2(int); /* prototype */
int f1(int foo) {
return f2(foo); /* f1 and f2 are possible because they are in the same translation unit */
}
int f2(int foo) {
return 42 + foo;
}
main.c:
int f1(int); /* prototype */
int f2(int); /* prototype */
int main(void) {
f1(10); /* f1 is seen on the linker - ok */
f2(12); /* f2 is not visible to linker - error */
return 0;
}
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.