I don't have an impostor syndrome, Am just an impostor 🔳
Please open Telegram to view this post
VIEW IN TELEGRAM
😭1
Today I found out about a function that I thought would now exit in the C standard library.
Basically I wanted something that would check if a string is a valid double and went and made something with a loop that works if u give it the right input if uk what am saying🤯 . Well that kinda did not set well with me so I made a quick search on gpt and BAM we got something that is in the standard lib that will work.
The function in question is🐵 ", this was quite a surprise.
I can't tell u how it converts it under the hood just yet but what I can tell u is how this helped me to check if a string is a valid double or not. So this is the function signature
So now by checking what the🤪 .
Basically I wanted something that would check if a string is a valid double and went and made something with a loop that works if u give it the right input if uk what am saying
The function in question is
strtod. What it does is simple, it just converts an array of chars to a double. Might look not impressive for most but for a guy that thought, "low level programming, HARD. low level programming has nothing I can't tell u how it converts it under the hood just yet but what I can tell u is how this helped me to check if a string is a valid double or not. So this is the function signature
double strtod(const char *str, char **str_end);, well str is the input string and str_end is a pointer to a pointer that stores the address of the first char in the string that was not converted. So now by checking what the
str_end is pointing to, we can check if a string is a valid double or nowPlease open Telegram to view this post
VIEW IN TELEGRAM
Man this AWS outage got me good bro. I spent 2hrs trying to figure out what when wrong with the code I wrote till I finally found out resend we down. Man I almost gave up and was gonna switch to another email api till I finally knew.
😭1