C Programming Tutorial 75, Converting Strings to Ints and Floats

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Ty so Much for helping saved my ass on my Academic project
Best ADAM

tuti
Автор

I felt good i guessed how to get that number at the index of 7!!!! that measn Adam you a great teacher! but what happens if i want to print all the string in the *myStr? can use a mix of functions like concatinating the first 6 index and the rest? or there is an easiest way?

thewhisperinyourears
Автор

Lol it's supposed to be cost/count
If eggs are 56 cents each, then 5 will cost around 2.50 not 8 dollars :P

MorcousWahba
Автор

How do I scan a file which is output into a string then pick out all the integers from the string? Each file will be different so how do I specify the point in the array in which the integer from ASCII search the string? 

adz
Автор

Very nice tutorial! Thank you, it will help me a lot to conclude my program
In the end of the video actually the conclusion is that with one dollar you can buy 56% of an egg hahaa just kidding

rafaelkenjiissaka
Автор

This is what I were looking for.
Thank you very much. Solved a big problem...

akhilc
Автор

Will this process work similarly for doubles? I’m trying to parse a string to double. Right now it’s only picking up the 1 of 1.2

DoSomethingProductive
Автор

Wow on a second thought i did not correctly guessed it! why you used int i = atoi(&myStr[7]); notice the & in myStr when myStr is already a pointer a address so you told me in a previous question that i did not need to use & because *variableName was already a pointer which is an address(this was when using scanf(). Now i am very confused do i have to use the & when is a pointer or not?

thewhisperinyourears
Автор

You help! Thanks. I was so struggling about atoi :)

montezhou
Автор

suppose i have a string like name, id, score of students and that is saved in a csv file (so coma will be removed ) like this (but without coma)
alvi, 123yu3, 60
jackson, 9844i12, 70
so now i want to take only the score and save them into an array .
but how can i take only score with atoi function will atoi will work here ??

ahamedalvi
Автор

Thanks a lot mate you really helped me a lot!

OlorinEa
Автор

It's works!!!! Thank you very much!

urielcomputers
Автор

i wrote sscaf(str, "for %i eggs it costs $%.2f", &eggcount, &cost) cuz i thought it'd be ok cuz we're reading a ".2f" float but it gave me a long-ass calculation result. i corrected it to %f from %.2f in sscanf and it worked fine. why?

simransingh
Автор

though I recognize that isn't the point of this video, and I thank you for this new information :)

MorcousWahba
Автор

Oh crap, haha my bad. Too late to fix it now.

iTzAdamX
Автор

Hallo why char and not string? And what is *myStr?

drakZes
Автор

your coding skills are good but please work on basic mathematics....
don't take it seriously..i know that is some silly mistake which everybody does...btw thanks a lot this is what i've been looking for..

rajatmaheshwari
Автор

why "char" and not string type?

UtopicVnzla