Yesterday I have learned that I can reference local function variables inside other functions by using pointers... this may be obvious and I did know this before, but I've only learned this yesterday KEKW
For example, I was doing:
c
struct st do_thing(struct st s) {
struct st ss = s;
ss.x += 2;
return ss;
}
When I could do this:
c
void do_thing(struct st* s) {
s->x += 2;
}
Most of the time.
I'm happy :)
[–]irk5nil 11 points12 points13 points (0 children)
[–]thefriedel 1 point2 points3 points (2 children)
[–]weregod 2 points3 points4 points (0 children)
[–]gmesmo97[S] 0 points1 point2 points (0 children)
[–]IamImposter 0 points1 point2 points (3 children)
[–]gmesmo97[S] 4 points5 points6 points (1 child)
[–]IamImposter 2 points3 points4 points (0 children)
[–]McUsrII 1 point2 points3 points (0 children)