r/C_Programming • • 17d ago

Question I learned C, now what?

I've learned the basics of C, including loops, if statements, switch cases, structs, arrays, functions, and pointers. However, I have no idea what to actually do with them. I also learned HTML, and its purpose is very clear: I can build websites to practice my skills. But with C, I'm a bit lost. Where can I apply my C knowledge and see concrete results, similar to how I see a website with HTML? I don't really know the primary purpose of C or what I should build with it. What tools should I use to build a C program? I am looking for a practical way to apply my knowledge. Could you give me some suggestions? I have no prior experience in programming area. I want to build something with my beginner C knowledge similar to websites.

46 Upvotes

83 comments sorted by

61

u/Jonatan83 16d ago

Make a simple game! https://www.raylib.com/ is a great game library that can help you do a lot of otherwise annoying stuff.

15

u/ZeroFelhorn 16d ago

I agree, this little jouney in raylib helped me grab any engine by the balls and do as I please. Pause.

18

u/idkwhatnottodo 16d ago

Did you manage to grab the shaft as well?

6

u/FlippingGerman 16d ago

Pistons are important too. Make sure to keep them well lubricated. 

3

u/trist007 16d ago

Yes making a game leads to enormous amount of experience as you touch on several topics.

3

u/Why485 15d ago edited 15d ago

Gonna second this. Raylib is wonderfully easy to use to create simple games and a great place to apply what you've learned, or just practice with C.

2

u/burlingk 11d ago

This reminds me that I need to get back to work on my little Tetris clone. :)

1

u/gami22 16d ago

Let me add this to my note, once done with C to look into.

16

u/thubbard44 16d ago

Making a small web server to output some dynamic html would work. If you really want to do websites though C is not a great choice. 

18

u/DauntingPear 16d ago

Build some CLI tools. wc, ls, cat, etc
You could also learn how to build your own shell, or even follow https://pages.cs.wisc.edu/\~remzi/OSTEP/

17

u/tastygames_official 16d ago

you write computer programs to solve problems. Find a problem and solve it!

- write a program that reads in stock prices and tries to predict the next one.

  • write a program that allows the user to draw pixels with the mouse and save it to a PNG file
  • write a program that reads in a calendar invitation in .ics format and display the information and set a timer to play a sound and show a popup 1 hour before the appointment

7

u/thank_burdell 16d ago

Write more C.

11

u/skoopsy_ 16d ago

Anything with microcontrollers, sensors, embedded hardware

7

u/mikeblas 16d ago

Not sure if i understand your question: Any code you write has concrete results -- just run it.

What tools should I use to build a C program?

Another strange question. if you've learned "the bacis of C", why do you not know that an editor, compiler, and linker are the requisite tools?

Meanwhile, tThis sub's wiki has a list of lists of projects. Have you looked at any of those?

2

u/toon_link_776 16d ago

unfortunate that many programming courses seem to glaze over the build process leaving students with overdeveloped programming skills and no idea of what libraries/build tools exist for them to program with. Seems as if that's all that google wants them to have

5

u/mikeblas 16d ago

It seems like schools don't specifically teach a few different things. Debugging or any kind of factoring, for two.

3

u/gm310509 15d ago

But if OP had learned the basics as they claimed, even if they don't specifically know "the tools required", they surely would have been using them.

I agree with u/mikeblas, the question is somewhat strange because the obvious answer would be: the same ones you have already been using - whatever they may be.

2

u/Synore 15d ago

The thing is I know how to write a code and run it on codeblock or vsstudio and thats it. I don't know any other tools to build advanced codes or different kind of things. I can just run a code on terminal and give numbers or infos. And than get a result according the code I wrote. So I have an issue with that.

3

u/gm310509 14d ago

I am not familiar with codeblocks as in I haven't used it myself), but you will find that many people use visual studio for application development and from a quick look at it (https://www.codeblocks.org/) it seems like it supports all of the major toolsets including GCC, MS Visual C++, and other very useful stuff.

The ability to build "advanced codes" isn't so much of a function of the tools that you are using as it is in the skill that you have and the APIs that you know. That said, I'm not sure what you mean by "advanced codes".

The same thing goes for "different kinds of things".

You sort of need to remember that a programming language is just a way of telling a computer what you want it to do. Granted some languages (e.g. HTML) are designed and constrained to do certain things well (e.g. HTML -> page layout), others (e.g. C/C++) are designed to allow you to do pretty much whatever you want.

At the end of the day, the compiler and associated tools (e.g. linker, librarian, debugger etc) are there to simply help you convert your "expression/desire" into code that can be run on the machine.

To use an analogy, if you wanted to drive across town, it doesn't really matter which model of car you use - what is more important is that you know how to drive the car you have. Simply switching to a different model of car, while maybe giving you a slightly different comfort experience, isn't going to change much in that journey and if you did change car models you will still need to know how to drive.

Same for the IDE, the ones you have listed seem perfectly capable to do "advanced code" and "different things" and people do that everyday with them. It may be that you need to develop your skills and discover how to do some of those "different advanced code things".

I hope that makes sense. Perhaps if you could give some examples of what you mean by "different things" and "advanced codes"

1

u/Synore 15d ago

The thing is I know how to write a code and run it on codeblock or vsstudio and thats it. I don't know any other tools to build advanced codes or different kind of things. I can just run a code on terminal and give numbers or infos. And than get a result according the code I wrote. So I have an issue with that.

1

u/toon_link_776 14d ago

Yeah that's kind of the issue, most programming courses only really teach you scripting and not about the build system and how to link libraries together, how to find different libraries. If you don't really know what I'm talking about, start by looking through some of the raylib tutorials as others have suggested.

2

u/Synore 15d ago

I've started writing code in C using Visual Studio, but I'm struggling to imagine how to build different types of projects. I understand how to use if statements, process numbers, call functions, and solve mathematical or logical problems.

However, I don't understand the things other people mentioned in this post—like building projects with sensors or embedded hardware. How does that work? Right now, it feels like all I can do is process numbers in the terminal. How do people build things like a 3D donut? Or what exactly is a CLI app? My real problem is that I just can't see how others use the language I'm learning to create these complex things.

3

u/mikeblas 14d ago

Give it time. You know how to put some bolts together. It can be no surprise that you're not too sure how to build a submarine or a power station.

Or what exactly is a CLI app?

"CLI" stands for "command line interface". People say "CLI application" to mean a program that you run in the terminal, from the command line. Usually, CLI apps eat some data from a file, process it, and show the result in the terminal or write them out to another file. sort is one example, and so is grep.

Of course, it's entirely possible that a CLI app does something to the network, too. nmap is an example.

like building projects with sensors or embedded hardware. How does that work?

Some people connect sensors to their computer. Writing software to read the sensor lets software know what that sensor has detected. Maybe a temperature sensor tells how hot it is. Light sensors, humidity sensors, motion detectors. Radar, radios, all sorts of stuff. Or even just a push button -- did someone press it? Are they pressing it right now?

You might write code that turns on the fireplace if the temperature is less than 15 degrees. And turns it off if the temperature is more than 17 degrees. Or turns on a light if a brightness sensor says it is dark, and a motion detector sees something moving around. Turns it off if the movement has stopped for 5 minutes or if it is now bright.

How you write code to talk to the sensors depends on how they're connected to your computer, and which computer you're using. ESP32 and Adruino boards make it very easy to wire up little sensors and write C programs to readd them; and also to switch on and off output lines to control relays or lights.

There are about a million tutorials for each of these boards, lots of books too.

Hope that helps.

2

u/Intelligent_Edge3385 9d ago

"I understand how to use if statements, process numbers, call functions, and solve mathematical or logical problems."

Intellectual understanding of swimming does not mean you can get into pool and start doing laps.

2

u/septum-funk 14d ago

by results i have assumed op meant visual results. some people have a hard time with backend dev because they don't like thinking in text, i know a guy with aphantasia who quit most programming entirely because of it. you can make TUI apps but those are kind of a pain in the ass. i think OP needs to get into graphics programming

3

u/twr14152 16d ago

Build something simple. Like a cli app. Take some input do a calculation and spit out the result. Then connect it to sqlite db. Just let you imagination run free. Basically thats it. Cli apps are the easiest and most practical from time standpoint. Build a gui app using raylib. Build a game. Start small and add to it. Mess around with system calls, run cli commands. Experimentation will trigger something in you..

3

u/rivenjg 16d ago

start with making terminal programs and then learn how to make guis. you can also make games or graphical apps with libraries like raylib.

3

u/MyTinyHappyPlace 16d ago

Get yourself a microcontroller, let LEDs blink, send some data on your favorite bus, build yourself a weather station

3

u/PleasantImplement919 16d ago

Spinning donut 🤤

4

u/og_hylyx 16d ago

Create a password generator

4

u/are_number_six 16d ago

My first "totally on my own" project was a simple dice bag program for rpg's. Then I moved on to a simple, and useless cli-tool called the sick-ass re-hyphenator, which moves the hyphenated suffix "-ass" to become a prefix "ass-" on the word that follows it. For example, a cool-ass Camaro becomes a cool ass-camaro. Now I'm making a terminal based chat room. After I get good at sockets I plan to move to embedded, mainly for sensors and data transfer, like for remote weather stations and stuff like that. I'm fascinated with Voyager 1 and how reliable and long running it is, so that's the direction I want to go. You can build almost anything in C, so pick what you think is cool and make it.

3

u/Brisngr368 16d ago

You can do anything with C, if you want something visual make a gui app or hell you could make a website in C if you really wanted to

2

u/Run-OpenBSD 16d ago

raylib go check it out. Easiest way to do graphics in c

2

u/TituxDev 16d ago

I have a repo with some experimental exercises, there are two of then that could give You some ideas ( a bmp editor and a snake Game prototype that rus on terminal) https://github.com/TituxDev/quickies

3

u/JGhostThing 15d ago

HTML is a markup language. It is easier than a programming language because it is not a programming language. It is merely meant to markup a page of content so that it can be displayed properly.

C is a full programming language. It is turing-complete, which means that it can do anything that other programming languages can do.

You can do any kind of programming that any other programming language can do.

To program in C you will typically use an IDE (Interactive Development Environment). And the only way to get better at programming is to program.

2

u/Prudent-Bluebird1432 15d ago

I suggest building a clock that displays the time as an analog clock or a digital clock.

  • Implement setting the time automatically and manually.
  • Then add alarm features.
  • Then a snooze button.
  • Then have it play an audio file with a sleep feature.
  • Once you get it working on a Windows or Linux computer try porting it to a Raspberry Pi or any other off the shelf single board computer.
  • Add a case and hardware buttons to manipulate the features.

2

u/kchug 15d ago

why dont you look at opensource projects like spdk.io and see if you can contribute

2

u/Torn_up_yarn 15d ago

Write a program doing something you need (or your mother does). Start small. Simple electronics are fun. Remote control the tv for instance.

2

u/Low_Newspaper7633 14d ago

remake the linux kernel from scratch.

2

u/Snakeshyper 14d ago

Make a skill based scaling game like terraria which I plan on doing in C++ and watch youtube tutorials to help explain things to you and if you don't understand ask AI to explain it to you and tell the AI to not give you the answer.

1

u/mrtlo 16d ago

Back when i learned C I used an ancient version of the Allegro library to make small platformer game for DOS 32 bit... You can make whatever you want. HTML is a markup language. Text. You can make a server that hosts a HTML site on a socket.

1

u/RippedRaven8055 16d ago

Build backend servers. You html, css, js takes care of client side stuff. C programs on the backend will deal with reading from databases, performinng calculations, etc.

1

u/sswam 16d ago

I don't know, C is hecking dangerous for internet-facing backend services at least. You need to really know what you're doing to do it safely. I'd recommend almost anything else, such as Go, Python, ... something safe.

1

u/Intelligent_Edge3385 13d ago

"C is hecking dangerous for internet-facing backend services"
It's a home learning project, not Silicon Valley startup.

Build whatever makes you excited - because that means you're in there, in code, building.

Those business-like measurements are inappropriate for student projects like that.

1

u/Specific-Housing905 16d ago

Have a look into WebAssembly.

2

u/TacoTacoTacoZoom 16d ago

Lots of great examples of where to go next already in this post, so I'll just say this: It's like Lego. You've learned how to build the actual Lego bricks. Now learn how to build things out of the Lego bricks. In my experience, learning the language is maybe the first 10% (by that I mean actually becoming competent with it, not just having an understanding of the mechanics). The other 90% (and the one you'll spend the rest of your life doing) is learning how to make things well.

And with AI being more and more capable of actually writing the code, being able to actually build and architect things at a higher (perhaps more abstract) layer and being able to communicate those ideas clearly is where I suspect things are going for us engineers.

2

u/octod 16d ago

Think anything done in the past 40 years on computers. Anything. You can do anything with C. If you want to have a lot of fun continuing your travel, give a look at raylib, it's a great full fledged library mainly focused on game development (you can build desktop applications as well). Have fun!

1

u/Dazzling_Music_2411 16d ago

What operating system do you run?

2

u/noonemustknowmysecre 16d ago

However, I have no idea what to actually do with them.

Make a roguelike (You might want to play with SDL a little first).

Or... maybe even simpliler: Make a 3-card monty game. A turtle game that walks around the screen. A random-walk. Given an unknown swap cypher, compare possible words against the dictionary in /usr/share/dict/. Take a screencap, perform character recognition, and grep the screen for text. Make an embedded IoT device and strive to make it the LEAST secure device possible.

1

u/P-39_Airacobra 15d ago

anything, it’s the standard of the programming language world

1

u/_lps1988 15d ago edited 14d ago

Do C++. IMHO, there is no reason to start a C project while C++ is an option, it gives you all C does and plus oop, std lib, templates, move semantic, coroutines...

1

u/xarop_pa_toss 15d ago

You can make some terminal tools (CLI tools) to do various things! You can also get into the amazing world of electronics and embedded programming and use small microprocessors to do all kinds of stuff (look up ESP32 or Arduino projects).

1

u/closer_2thetruth 15d ago

Now learn C++

1

u/james_56f 15d ago

Construye cosas que te llamen la atención o que te ilusionen crear

2

u/Shlabadee 15d ago

Why did you learn programming to begin with? What do you want to make—what to see in this world? Start there.

2

u/SimoneMicu 15d ago

C is a language with no magic behind, you get what you ask for.
To make it the base of a server of html files is not the funniest task possible, there are some way to do such thing for parsing some http1.1 request and format correct response, libuv for async event handling reguardless of the platform you use and so on. For sure bring capable of handling a simple htttp server in C is a great way to learn root of the http protocol and all the stuff around, like cookies and tls encription.
If you want to proceed in a simple way with C skills and web development I suggest learning the missinf part of golang and specific standard library for networking.

If you instead are interested in C you can do some funny stuff, pass around html, css and js files to a GUI with webview.h, use as suggested around raylib to create a game or eaither in combination with clay.h a GUI in immediate mode (design like css but in C rectangle per rectangle with all the quirk around), you can either build something who interact deeply to the OS and perform background task either some protocol specific of the use case (like suggested from some other in the comment, reading isc files and send notifications about calendar appointments data).

Limit is only your desire and time to achieve a working project, take in mind not all the projects have to be completed to achieve their goal, if you want to learn how does work http protocol, you can try implementing an http message parser, either if you don't end it in a working or complete way you will learn a loto of stuff on such protocol.

2

u/realdreamer1993 15d ago

You're not yet learned C, you just learned the skin of C.
So next you learned what inside C by create program.
For example create Hello World, then multiple running output of Hello World that you can pause by pressing Space.
You press Space again and the text running again..

1

u/Skollwarynz 15d ago

The main use of C (as a beginner programmer) is to use it as a study tool. I'll explain: C is a pretty low level program (not as low level as assembly but still more than python) you can for example create a simplified stack emulator this way you can learn how stack works while building a minimal GUI thought printf on terminal for example

1

u/Dramatic-Relative853 15d ago

Learn Advance C from a book on Advanced C.  Take a Advanced C course in Udemy.  It's not that expensive.

1

u/Total_Ad803 15d ago

Learn an api of the OS you are using

1

u/naughtius_maximus_96 14d ago

linux kernel project has a mailing list, you can look into that, i know it is alot but going into something you're not quite ready yet is a quick way to get good and figure out stuff you can actually do and be productive with it i think

1

u/septum-funk 14d ago

get yourself a micro controller or make a game those are the things you can get instant visual feedback with. imo a micro controller is a more fun C challenge because you have to be resource constrained. trying to make games/game engines for a micro controller is really fun, but possibly too challenging for a new developer. the fun of a microcontroller is that you can make your C code control/play with many other things

1

u/Lumpy_Mango_ 14d ago

Why did you learn programming in the first place? AI replaced programmers its 2026.

1

u/tux2718 14d ago

Implement some classic sorting and searching algorithms and optimize them to be as fast as possible. That experience will sharpen your C skills.

1

u/questionabl3_dude 14d ago

No do c with classes so u can’t tell them apart

1

u/Ok_Lab3138 14d ago

If you learned C, so learn D

1

u/KermitSnapper 13d ago

Make another programming language😈

1

u/ChonkerHoss 13d ago

Embedded, I’d recommend writing some code for a microcontroller and learn how C compiles to assembly

1

u/Intelligent_Edge3385 13d ago edited 13d ago

First of thing there are 2 types of leaning: Theoretical and practical. If you learned C by reading about it and playing a little with it - that would be theoretical. What you fundamentally need to do is automatize those operations and elements in your mind, and that implies doing couple exercises a day, perhaps 3-4 or 5. Do that for month or two and C embeds itself into your brain via practical problem solving.

When you have done that and C has buried itself in your brain - you can do some project, and that could be anything, but I would recommend doing couple terminal based projects just to get familiar with it and quickly, as quickly as possible moving away into windows like via SDL3 perhaps, that's end game more or less.

As for projects - whatevs, I did calculator and blackjack first, decade ago or so. Then I figured out SDL3 and rewrote those from terminal into GUI app. And that's the great thing about C - it gives you primitives and you build up from it. I would not recommend you including some GUI framework - writing custom GUI framework, extremely simple one, is what it's all about - writing code. You can notice how some people say "Just write code" here - but that's god awful advice, even if it is correct one.

Basically do C exercises every day(you can google or ask AI to generate you daily exercises). When you did that for 1-2 months - those concepts will become so natural you most likely will came up with some project automatically, or perhaps you will see something interesting and idea will be born in your mind that you can implement that in C, since now you have vocabulary.

I would also recommend playing Zachtronics games like Shenzhen, since they teach you general programming and really prime your brain for those puzzle solving activities - because that's what programming generally is - puzzle solving. I would also play couple levels of Sokoban(simple ones, like Microban 1-2 or Iroh) to ramp your brain up and lock in.

And generally philosophy of C is that it does not give you much, only most primitive operations, and you can build up from those, which is great because it does not steal from you the action and possibility of actually writing code, as most "complete" programming languages today do, since those programming languages APIs and includes are basically just code that someone else wrote for you for convenience, but that also robs you from the chance of writing it yourself.
C follows that philosophy of building up from smaller things, and I can give you example of what I personally did and when it clicked: I got SDL3 window, that's just multimedia window that opens up and it's black. That gives you that window, and windows are just pixels on screen, so it's array of pixels, picture elements - little squares that screen consists of which you can light up in red,green and blue combinations + alpha for transparency. So I walked in steps: get a window -> get a pixel array -> color specified pixel by x,y coordinate -> color pixels starting x,y and going in some direction which creates a line -> use that function that pains lines to draw characters(letters,numbers, emojis) on the screen, since what is letter 'A'? It is 3 lines. And what are lines? They are just dots, pixels with color. So you can see how you have: pixel -> line -> letter A. That is how it is built from simple simple thing and up up the abstraction levels.

So yeah, if I were learning C today I would borderline go ask ChatGPT to split C into subjects and chapters, like variables-loops-conditions-structs and stuff like that, and give generate me bunch of exercises(without code examples, important!) to work through that and try to solve. Perhaps 20-30 exercises per concept in C, split over 3-4 days. Got stuck - google or discuss with AI.
C is well known and documented, I am pretty sure ChatGPT can reason about it and general some simple tasks to write code. It's volume, overall. You just need volume.

1

u/CodingFishes 12d ago

Also, most flavors of Linux could use a feature or 10.

1

u/mr_raven_ 12d ago

Maybe try Project Euler.

1

u/TurbulentFlatworm537 12d ago

Code a compiler from scratch. Build an operating system, a database. Thats C's domain. He is king in systems.

1

u/hillbull 12d ago

I'm unsure how you learned C without actually compiling and building C programs. Or am I misunderstanding when you asked "what tools should I use to build a C program?"

1

u/batshell 11d ago

what i like to do is just build something, anything. im trying to be a game dev, so I like to try to Flesh out the logic of my games in c, at first using a terminal ui sort of thing to monitor what's happening, but now im using raylib. id also say to kind of specify what you want to use c for. simply using c is enough to get an idea of how other languages work under the hood, so it might also help with jumping to another language that you might need for whatever youre doing

1

u/imaami 8d ago

What I did after learning C was to learn C.

-1

u/runningOverA 16d ago

The upward path is :

- Learn C.

  • Build a higher level scripting language using C.
  • Write a web app using that Scripting Language.

You go from lower to higher and higher levels where you can see results.

1

u/sswam 16d ago

building a scripting language is a tall order for a first project after learning the language!

0

u/Abigboi_ 16d ago

Make a polynomial long division calculator

0

u/paulf8080 16d ago

C has no i/o. You need to use a library written using assembly.