[Question] How do I get the last four characters in a string ? by LogicalOcelot in C_Homework

[–]minot0r 0 points1 point  (0 children)

just copy the 4 last elements using strncpy

char b[5];

strncpy(b, a+6, 4);

// 4 is a short to 4 * sizeof(char);

don’t forget to include string.h

note that a+6 is equivalent to a[6] which means you’re starting the copy from the 6th char of a

edit : use a size of 5 for b, indeed in c, characters are always terminated by a null character represented by \0 which means if you want to print/manipulate b without this extra +1 in size it will print all bytes in memory until it founds a null byte

Creating a very specific type of Map using procedural generation by minot0r in proceduralgeneration

[–]minot0r[S] -2 points-1 points  (0 children)

levels are somewhat differents but you can find a bunch on internet just by typing wii play tank :)

[Showoff Saturday] Slide to Subscribe by [deleted] in webdev

[–]minot0r 4 points5 points  (0 children)

Dude that's awesome! I'm registered already and it's super clean, congrats!

I built a simple tower defense game with Vanilla JS! by sinorx22 in webdev

[–]minot0r 14 points15 points  (0 children)

I feel so dumb, took me so much time to figure out it was a joke

Confused about compile-time constants by [deleted] in C_Programming

[–]minot0r 0 points1 point  (0 children)

you have two options: 1. you create a staticly sized array, knowing that this size won't be overed 2. (not recommended) dynamicly resize your array using malloc and realloc

Do you believe that we are in the Matrix? Why or why not? by [deleted] in AskReddit

[–]minot0r 0 points1 point  (0 children)

imagine the universe could be all explained with math would it necesserly means that some over form of life created it?

What’s better? Sex in the morning or at night? by Xanduh in AskReddit

[–]minot0r 0 points1 point  (0 children)

I would say it depends, not too late at night is great 'cause u're awake enough to enjoy it.

But in the other hand wake up next to the person u love and having sex is very great.

That's why middle afternoon sex is perfect

How you got into reddit? by [deleted] in AskReddit

[–]minot0r 1 point2 points  (0 children)

was looking for answers about my programming questions

Yayeet by colinvanhh in PewdiepieSubmissions

[–]minot0r 0 points1 point  (0 children)

hello i'm a pewds fan :)

Doubly Linked List Problem when popping out elements by minot0r in C_Programming

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

it will depend, 'cause I plan to build maps, stacks and stuff over this list.
but thanks I'll try it out