My Time with the C Programming Language

image

The language that started it all. Well, not technically, but in spirit. The C Programming language is something that I’ve been trying to muster the courage to dig deeper on. I say “courage”, and it seems silly, but it does take a lot to invest some time into.

This is going to be a continuation of my previous experiments. I was rewriting a shell that I built in college (and in C++), but it stopped working. I have something in mind that I want to be cross platform in C, that handles processes, input redirection, and displays output. It’ll do a lot more than that, too, but those are the primary functions I’m working with.

I am using FreeBSD, Windows 10, and Ubuntu as my test benches. I am also using clang as the compiler, no offense to GCC, but I am trying to get familiar with the other tools, and those native to the non GNU operating systems.

So, here we go! This is what I have so far:

main.c

#include "shell.c"

int main(int argc, char **argv) {
    start_adsh();

    return EXIT_SUCCESS;
}

That’s it! Looking forward to… actually… building this thing :sweat_smile:

4 Likes

> including c files

atleast give a trigger warning.

Jokes aside, C is great. C++ is technically my 1st lang, but really it was C since we only used std::cout from c++. But later i went with C#, while it was cool, after getting back to C, I understand why it’s so awesome. Coz it assumes you know what you’re doing, and doesn’t get in your way.

tl;dr good luck, just take it slow, C rewards patience. That said, i usually just bruteforce my way lol.

3 Likes

Lol. Do you use one big file? But muh elegance.

Appreciate your advice. That was my plan. Take it slowly and get some good ideas going. Test and fortify and move on

header files bruh :wink:

u’ve seen my code a bit

1 Like

We got something :wink:

@rgk @MFZuul @SgtAwesomesauce

image

1 Like

image

ezpz, took me 25 mins :wink:

2 Likes

Ayyy we have a lot of the same imports :grin:

image

2 Likes

added args :wink:

image

https://bitbucket.org/redpandaua/rsh

if you’re curios

2 Likes

ur so 31337.

Impressive, man. I am going to clean my source up so I am not embarrassed to share lol.

2 Likes

tfw using libc and posix shit is elite lol

2 Likes

You’d be surprised :wink:

I had a professor/mentor tell me that once you grasp loops, decisions, arrays, functions, reading from and writing to files, you’re a proficient programmer. Anything beyond that is advanced

gek == advanced

true

3 Likes

I even use double pointers sometimes

2 Likes

11 posts were merged into an existing topic: The Freeland [New Lounge Order Edition]

member when u said i write understandable C?

think again bud

IMG_20190527_162111_738

3 Likes

Literally Shaking

2 Likes

Seriously though, wtf is the point of that lol.

Job security through obfuscation?

2 Likes

bit manipulation

3 Likes