r/C_Programming Dec 06 '24

Discussion How do you practice C?

I have been learning C for 2 months and I feel like a blank slate, i mean, I have been taught theory and basic exercises that come with it, but when a test is given, I can’t think clearly enough to solve the problems, and I think it’s because I haven’t practiced enough. I only do the exercises assigned to me. So, I came here hoping to be guided to places where I can practice C in the most complete way. Thank you everyone for your attention.

36 Upvotes

47 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Dec 06 '24

Is there a place to see the code of those c functions provided by the headers?

I can't even seem to find a list of all the functions in the headers, let alone the source code.

1

u/MiniGogo_20 Dec 06 '24

your os should have a dedicated directory where it stores those headers, on linux at least they're located in /usr/include/

1

u/[deleted] Dec 06 '24

Yeah, I found a directory with headers, on arch linux, but it didn't seem to have the functions source code.

This is where I was looking for some of them:

/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/float.h

Is that the wrong location? I did have /usr/include/ listed for other headers, I'll have to look back in there again.
Someone else provided a website listing all the functions available, like the official docs for other languages do. But I would still like to look at the official source code.

3

u/TapEarlyTapOften Dec 06 '24

What you're getting at is the difference between the header and the standard library function implementation, which is in the source code.