Пікірлер
@wintc
@wintc 2 сағат бұрын
The version of string_f64 shown in this video has a bug which means it does not correctly print the sign for values in the range (-1, 0). See the fix here: kzbin.info/www/bejne/npfWlI2YnLpki68
@ThiagoOliveira-ex3vw
@ThiagoOliveira-ex3vw 19 сағат бұрын
I've never seen code like this haha the returning type on the first line, then the name of the function on the next line, then each argument on one line, and the commas starting the line of each argument... Holy cow
@wintc
@wintc 21 күн бұрын
See how to remove the dependence on resizable string_t* in parse_argument_array in the following video: kzbin.info/www/bejne/gmPFc2eDYrl3nJIsi=WbTxmMYt5rNoeYP9
@pierredeloince9073
@pierredeloince9073 25 күн бұрын
👏👏👏👏👏👏
@happygofishing
@happygofishing 27 күн бұрын
this channel is heat, set a profile picture and a new username and you will actually get recognition.
@Yokai2510
@Yokai2510 Ай бұрын
Very good way to learn and practice programming
@balram8223
@balram8223 Ай бұрын
i guess you should do implementing my own list next
@happygofishing
@happygofishing Ай бұрын
This video will blow up.
@nizidev
@nizidev Ай бұрын
Great video
@grenadier4702
@grenadier4702 Ай бұрын
Nice job. How much time did it take?
@wintc
@wintc Ай бұрын
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 Ай бұрын
this is neat, I'm curious how you'd actually do print to screen though. Like rewrite cout
@wintc
@wintc Ай бұрын
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.
@wintc
@wintc Ай бұрын
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 Ай бұрын
Do you knew this guy before hand or did you discovered him ? Just interested in how algorithm works.
@grenadier4702
@grenadier4702 Ай бұрын
For example, on posix-compliant systems it's the write syscall
@hawks3109
@hawks3109 Ай бұрын
@@wintc 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
@wintc
@wintc Ай бұрын
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: kzbin.info/www/bejne/g6jYk4Rjhayhm7Msi=RhUrpyLDdy3E9mBV
@KeithKazamaFlick
@KeithKazamaFlick Ай бұрын
very good video
@roejogan1759
@roejogan1759 Ай бұрын
nice