0

How i can create a header file in solo learn in language C

17th May 2020, 3:33 AM
Hichem Abdi
Hichem Abdi - avatar
10 odpowiedzi
+ 1
This sound strange! Can you post a sample?
17th May 2020, 4:55 AM
Bilbo Baggins
Bilbo Baggins - avatar
+ 1
Maybe you say it is "not optimal" because it is less readable? In fact the behaviour is identical if you define your union in the main C file or in a separate H file. In both cases the program works well. I do not see any way to put a separate header file in the temporary directory which SoloLearn assign to you. I would start to print the bits from the most significant to the least significant, anyway.
18th May 2020, 4:30 AM
Bilbo Baggins
Bilbo Baggins - avatar
+ 1
I see... you are a purist 😉 So no function pointers, no goto's, no continue's, no multiple returns... I cannot blame you, but I am too old to change my programming habits... And I love C for its possibility of making "dirty" stuff 😁
18th May 2020, 5:08 PM
Bilbo Baggins
Bilbo Baggins - avatar
0
Thank you , but i want to crate a union in header file , and i found when i put it with main function it's not optimal !!
17th May 2020, 4:33 AM
Hichem Abdi
Hichem Abdi - avatar
0
Ok you can see this code , i want to make the union in header file https://code.sololearn.com/curr1CCCh3V2/?ref=app
18th May 2020, 12:32 AM
Hichem Abdi
Hichem Abdi - avatar
0
Martin Taylor i guess to write those function , with static
19th May 2020, 3:22 AM
Hichem Abdi
Hichem Abdi - avatar
0
Ok but let me ask a question : why we teach a new language without knowing it rules ?? Or just for have fun !! Others, each compiler specified and different from the other , finally we should teach the rules and technical of programming! Thank you
19th May 2020, 11:51 PM
Hichem Abdi
Hichem Abdi - avatar
- 1
Yes i agree with you :) , but we should perfom it with MISRA rules ?
18th May 2020, 4:45 PM
Hichem Abdi
Hichem Abdi - avatar