Пікірлер
@Yokai2510
@Yokai2510 3 күн бұрын
Very good way to learn and practice programming
@balram8223
@balram8223 4 күн бұрын
i guess you should do implementing my own list next
@happygofishing
@happygofishing 6 күн бұрын
This video will blow up.
@nizidev
@nizidev 7 күн бұрын
Great video
@grenadier4702
@grenadier4702 7 күн бұрын
Nice job. How much time did it take?
@user-fc8xw4fi5v
@user-fc8xw4fi5v 7 күн бұрын
The main string_format skeleton took only a day or so, but definitely took at least a month to write all my own platform layer stuff + unit tests to achieve proper handling of edge cases.
@hawks3109
@hawks3109 8 күн бұрын
this is neat, I'm curious how you'd actually do print to screen though. Like rewrite cout
@user-fc8xw4fi5v
@user-fc8xw4fi5v 8 күн бұрын
I can do a video on file I/O if you'd like, but it's OS-dependent. So there'd be separate *nix vs Windows videos.
@user-fc8xw4fi5v
@user-fc8xw4fi5v 8 күн бұрын
Edit: if you want a quick way using libc to print your final string to stdout: #include <stdio.h> #include <string.h> fwrite ( string , 1 , strlen ( string ) , stdout );
@AyushSharma-yf3qu
@AyushSharma-yf3qu 7 күн бұрын
Do you knew this guy before hand or did you discovered him ? Just interested in how algorithm works.
@grenadier4702
@grenadier4702 7 күн бұрын
For example, on posix-compliant systems it's the write syscall
@hawks3109
@hawks3109 6 күн бұрын
@@user-fc8xw4fi5v ah okay it's just a system call. I figured there would need to be more work to set up buffers and such first in specific places. I suppose that would be as the asm level though. Thanks for the quick reply! The video idea would be cool, I've always wanted to write a device driver or something that directly controls hardware. I just don't really know where to start
@user-fc8xw4fi5v
@user-fc8xw4fi5v 10 күн бұрын
NOTE: At the end of the video, I show an example where we generate string padding on the fly using wildcard format modifiers. This evaluates down at compile-time to the value of the longest **possible** key name string; but, you could also significantly improve the appearance of the output string from what is shown in the video using existing functionality by simply storing in your keymap container a field such as `longest_key_name`. Each time you add a key binding at runtime, update `longest_key_name` if it is shorter than the name of the key being added; then, have your wildcard generate the padding from `longest_key_name`--since wildcards are evaluated at runtime, it works in a way that printf cannot! This way, string_keymap only ever prints **exactly** as many characters as it needs! (In the video, there's extra padding because the key names I used were a lot shorter than the max). Watch me implement the fix here: kzfaq.info/get/bejne/g92llbReta3SlYU.htmlsi=RhUrpyLDdy3E9mBV
@KeithKazamaFlick
@KeithKazamaFlick 11 күн бұрын
very good video
@roejogan1759
@roejogan1759 11 күн бұрын
nice