Skip to content

Instantly share code, notes, and snippets.

View Mroik's full-sized avatar

Mroik/PositiveC Mroik

View GitHub Profile
@Mroik
Mroik / OOP_in_C.c
Last active January 27, 2022 00:10
This is an example of how to program with OOP paradigm in C (why would you ever do this)
#include <stdio.h>
#include <stdlib.h>
typedef int(*int_ptr)(test);
typedef struct {
int a;
int_ptr next;
} test;
int next_r(test* self)
@Mroik
Mroik / split.c
Created February 22, 2021 23:17
split function for strings implemented in C
int split(char *string, char sep, int n_char, char ***array_values)
{
int n_values = 1;
int start = 0;
for(int x = 0; x < n_char; x++)
{
if(string[x] == sep)
n_values++;
}

Keybase proof

I hereby claim:

  • I am mroik on github.
  • I am mroik (https://keybase.io/mroik) on keybase.
  • I have a public key ASBnpSDjaJtoZZWtpHb7Uh_HyAeUm3urXCdIVYvEu5nnbgo

To claim this, I am signing this object: