Static Functions | C Programming Tutorial

Static Functions | C Programming Tutorial

Portfolio Courses

2 года назад

8,231 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@gammyhorse
@gammyhorse - 15.09.2022 21:51

Sir, can you make an example of how to do a unity build of multiple files?

Ответить
@fusca14tube
@fusca14tube - 16.09.2022 05:47

Hi, awesome subject. In a more advanced way, the static function doesn't have the name (string) in the binary's symbol table. The compiled code is still there and can be called directly, let's say, in the main() by the function address (using function pointer), but not by the function name. Unfortunately, you need to discover the address of the static function somehow.

Ответить
@beegdigit9811
@beegdigit9811 - 29.03.2023 19:08

If they limit the scope making it "private" to the translation unit why do we even need header files (for documentation purposes?)
When I don't include a header file I can still use non-static functions defined in the other file (even though I get an implicit declaration warning)

Ответить
@blankdisk1061
@blankdisk1061 - 14.04.2023 14:06

.

Ответить
@egonkirchof
@egonkirchof - 07.03.2024 00:59

They should have used private instead of static.

Ответить
@vicsteiner
@vicsteiner - 17.07.2024 18:01

Another nice video, thanks. The doubt the stood in my mind is that if we change the effect of the function in the interface, in the example report_value wouldn't you still risk to break the program because even though the function signature did not change the effect (could be the return value) did change. I thought that we could change the static print but without affecting the return value or effect for the interface function otherwise the change would have to be communicated to all users of the interface I assume.

Ответить