/dcg/ - Daily C General

What are you working on with C today Jow Forums?

Attached: C.png (867x812, 1.22M)

Other urls found in this thread:

github.com/enfiskutensykkel/ssd-gpu-dma
twitter.com/SFWRedditImages

bumping your sad thread op

Rewriting sepples game engine in C

This

Shortest code to get a segfault

>shilling your shitty game engine

I don't like my calculator that I use for class, so I want to make one. I've made a text-based calculator in C that handles infix math expressions without using dynamic memory allocation or recursion. It isn't the fastest way to do it, but it will be suitable for porting to a microcontroller. I'm currently debating whether macro support would be useful.

int main = 0;

I'm continuing work on pic related.

I will make some attempts to get this up and working on it, trying to make some benchmark numbers: github.com/enfiskutensykkel/ssd-gpu-dma

Attached: IMG_0501.jpg (2101x1962, 1.27M)

Bump

Sad bump

Attached: nickle.jpg (1220x1480, 304K)

Is it hard to learn C when my first language was Python and I got really accustomed to it? It really makes everything simple and easy to accomplish whereas C seems so cryptic at times. Or most of the time.

Does anyone have tips for not falling back into an oo mindset while learning c? I've been working with c++ for years and as a result I often find myself littering the program with structs and wanting to put structs in structs.

Trying to make people finally forget it ever existed.

>littering the program with structs and wanting to put structs in structs.
This is not a problem if those members belong together.

C is always a bit tedious to work, because you have to deal with memory allocation. But C isn't a very difficult language, as there are only a handful of constructs to learn.

have api access to a few AV cloud servers. making my own AV daemon to use those and clamav for scanning. features such as real time protection and file system scans. one issue i am having on linux is that when a process executes and then quits or forks i cant get the process details fast enough (using proc event filter). is there a way to block executes on linux?

>is there a way to block executes on linux?
What do you mean?

Diretx or open

If I won't find any better summer internship, I will work on academic OS kernel. I did it before, but it was blind poking before OS course, now it should go better. I don't know if I really want it, but I would be ok with it. Only sad part that I will have literally 1 person to work with me.

if someone runs an executable program, i use proc event filter (netlink) to be notified of the event. is it possible to receive the event before it happens and possibly deny it?

I've never used proc event filter, so I don't know. But for denying executables, AppArmour if you're using Ubuntu, otherwise cgroups and SELinux.

Music player. I can't choose a library

Doesn't everyone just read the minix book?

Why not write an OS from scratch? Or is it an already set internship thingy?

I mean, our course is based on Tanenbaum's book, so, I guess?
Well it's slightly more (or less) than academic OS. It is OS written from scratch by some dude who made minimal viable product, went with it to shitton of conferences, and for some reason dudes from my university kinda adopted it, and now there is possibility to work on it as part of internship. OS is not a UNIX clone or your regular OS, it has some stupid features which I don't care about because I will work on kernel and stuff.

Sounds cool enough though.

I have lots of projects in mind that I have been working on for the past few months but never really finished them, but the one I'm focusing on right now is a compiler that compiles a small assembly-like language to PlayStation executables.

Creating a game using nothing but open gl , using glfw, open al, been working on it since 2015

Nothing wrong at all with that, I use macros for generics which isn't for everyone

that sounds horrific

Can I see screenshots?

Doing the cs50 course, only got to pset2 so far but I started like 2 weeks ago. Doing the whole thing as a hobby while still going to my day to day job.

Nice.

You can actually write it shorter, as all global/static variables are set to zero.

int main;

I think that's undefined behavior, but it would be unlikely, maybe impossible for it not to seg fault even if it was a random number.

No, global variables are set to zero, that’s defined in the standard. Of course, setting main to 0/NULL and then invoking it is in itself undefined behaviour, if that’s what you meant?

I did not know global variables are always set to zero, I always do it manually, thanks for the info.

Static variables are too. In short, variables that are known during compile time (global and static) are initialised, whereas variables that are not known (i.e. local or dynamically allocated) aren’t.

Good to know, makes sense.

What is this?

didn't even notice the watermark.

It defaults to int so
main;
Works too.

You could even just
a;

And then set 'a' as the main through compile flags.