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
c-calc is a calculator I made for my-self using C. I mostly started the project cause I had a power outage and made it as a joke but after realizing I don't have a real calculator on my PC ( arch btw) and decided to make some thing that I would use as a primary calculator.
It can accept any mathematical expression which only contains number (e.g
here is the github repo: https://github.com/kidusm001/c-calc
It can accept any mathematical expression which only contains number (e.g
( 2 + 2 ) *6.9 +2+ 22-(420- 69)+6+ 7 ) and returns a correct result. If u use wl-clipboard it will copy the result to the clipboard.here is the github repo: https://github.com/kidusm001/c-calc
GitHub
GitHub - kidusm001/c-calc
Contribute to kidusm001/c-calc development by creating an account on GitHub.
👏5
Tagged unions are pretty cool. If u make a programming language anytime soon please include some sort of way to use tagged unions.
Can never forget the day that our Unix Lab instructor told us to execute 🐈
touch girl command, and went on a rant on how doing an SA is bad for societyPlease open Telegram to view this post
VIEW IN TELEGRAM
🤣3