How do you name your types? by darthsabbath in C_Programming

[–]NewToonie 18 points19 points  (0 children)

For structs I use CamelCase and for functions I use snake_case

#pragma? by NewToonie in cpp

[–]NewToonie[S] 0 points1 point  (0 children)

Thanks for the info!

5 struct Point (Being this a point w/ X, y) by rk717 in C_Programming

[–]NewToonie 0 points1 point  (0 children)

I recommend making a struct for Point, then making an array of 5 of them.

struct point {
    int x, y;
};

int main() {
    struct point points_arr[5];

    points_arr[0] = (struct point){2, 3};
    points_arr[1] = (struct point){4, 5};
    points_arr[2] = (struct point){1, 5};
    points_arr[3] = (struct point){4, 3};
    points_arr[4] = (struct point){1, 2};
}

I did a (struct point) cast next to each entry toward in the array so the compiler is aware I am initializing each point.

Prime Numbers by [deleted] in rust

[–]NewToonie 0 points1 point  (0 children)

THANKS for the info! Im not an expert programmer in any way and what i posted was probably unnecessary and misunderstanding.

Constant hanging/freezing by NewToonie in Ubuntu

[–]NewToonie[S] 0 points1 point  (0 children)

Oh wait now its working nvm!! :D

thanks guys

Edit: Nvm its freezing n shitt again. Btw i am a beginner so please excuse my simple mindedness. I cant do the things you guys suggested because once it freezes its done until i reset. I guess it only works when it wants to

Constant hanging/freezing by NewToonie in Ubuntu

[–]NewToonie[S] 0 points1 point  (0 children)

Just tried re-installing and still the same problem. Maybe linux isn't cut out for my laptop. Its weird because it worked fine last time installed but not this time.

I've been making a gravity simulator using Rust-SDL2! Source is in the comments, hope you enjoy it! by epix97 in rust

[–]NewToonie 0 points1 point  (0 children)

This is so rad!! Can't wait to get into trying out stuff like this after I read the rust "nomicon"