Share A Global Variable Across Multiple Files By Using extern | C Programming Example

Share A Global Variable Across Multiple Files By Using extern | C Programming Example

Portfolio Courses

2 года назад

25,560 Просмотров

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


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

@SebastianMedina
@SebastianMedina - 08.11.2024 10:02

Thank you ! great explanation

Ответить
- 24.07.2024 13:51

Very clear explaination ,thank you for doing this.

Ответить
@mehmetaltinsoy525
@mehmetaltinsoy525 - 25.06.2024 10:12

Thanks

Ответить
@mtraven23
@mtraven23 - 04.03.2024 11:25

really crisp explanation.

I've got a project working in the manor you outline, extern in C, def in H and access from main. I have several other classes I'd also like to have access to that extern object. But when I try to include it with any of the other files, the compiler doesn't like it. anyone got any ideas?

Ответить
@gordazo0
@gordazo0 - 12.01.2024 02:30

The advantage is no allocation?

Ответить
@Lulxec
@Lulxec - 19.08.2023 20:58

Thank you for the great explanation, the funtions dont need extern deckaration right?

Ответить
@danielzuzut2427
@danielzuzut2427 - 07.04.2023 02:12

Thank a lot for your videos!!

if you or someone have tip to my case , i will be grateful
what can i do if i get the error "multiple definition" while i need to get two char[] from the user amd compare them (strcmp function)

Ответить
@ranveervaghela7030
@ranveervaghela7030 - 22.03.2023 19:13

You've made fricking awesome c example playlist enjoying a lot
Thanks :)

Ответить
@DEVVAIBHAV
@DEVVAIBHAV - 11.03.2023 21:48

Thanks! your video helped me a lot with my project :)

Ответить
@jimmyhopkins5145
@jimmyhopkins5145 - 07.01.2023 04:59

Thank you so much this was helpful!
Is there a way to change the value of the variable inside the library.c file through the c file in which we included library.c file?
Thank you.

Ответить
@programacionpse3520
@programacionpse3520 - 08.12.2022 12:58

Man i like your videos!
Keep it up...

Ответить
@mrafayshams3089
@mrafayshams3089 - 07.12.2022 16:30

I have a states.h header file that has no C source file because the states.h only contains an enum of states. I want this enum to be global; how can I make it global and accessible across all the files that include states.h.

//states.h
typedef enum {state1, state2, state3} STATES;
extern STATES state;

I want the state to be global.

Ответить
@ethanehunt9655
@ethanehunt9655 - 08.11.2022 17:25

No trash talk....just to the point with crystal clear explanation... thanks mate!!

Ответить
@loadfield1133
@loadfield1133 - 26.03.2022 05:03

Very clear explaination ,thank you for doing this.

Ответить