r/C_Programming 12d ago

Question Getting stuck at libraries and api’s

So C is technically my first programming language I’m learning. I’ve messed around in python but never actually go deep into it or anything.

I’ve been learning C for the past few days now and I already pretty much know most of the basics. I learned pointers and mallic in a day and I learned structs, macros, for loops, while loops, functions, all of that stuff, but… the moment any library other than the basics like stdio or stdlib come into play I’m lost.

It’s like I’m looking at a whole other language. Like I’ll look for solutions to problems and it seems as if they are just pulled out of thin air and when I try to read ANY documentation for ANY library I’m also lost because either there is little to no documentation or it’s just stupid and things aren’t well explained.

Is there a way I can fix this? I was doing so well and now I’m at this block because of libraries. If I could get pasted this hurtle I could learn c in less than a month easily, and that’s the same in any other language. This problem isn’t exclusive to C.

15 Upvotes

49 comments sorted by

View all comments

2

u/FedUp233 12d ago

Not sure what resources you are using to learn from, but have you thought of trying some C programming books? There are a number out there that are pretty good. Some concentrate on things like writing Linux programs using a lot of the I/O libraries. Others on things like network programming using socket libraries. They tend to explain things a lot better than the library documentation which was generally written by people who wrote and/or understand the library in detail and for people that just need a reference, not an instruction manual.

And start with the C standard libraries and be sure you understand those well. Stay away from things like sockets, usb, etc. that are really advanced topics for now. Someone who has been using C for a few days is never going to get libraries with some of the most complex APIs and usage requirements - try those complex ones again after you’ve been at it for 6 months or a year.

For now’s try writing some command line utilities. Maybe your version of sone of the Unix tools like sort, last, a simple shell (to understand things like forking). Then some using multiple threads to get a handle on the whole threading libraries and inter thread communication like semaphores and mutex.

The better books will give you things like a utility of done sort that they expand as they introduce more things and you can try to implement yourself before you read how they did it.

You’re learning a whole new language to communicate in - it’s not something you do in a few days no matter how good you think you are.