+ 1
is there a split() for c++?
Sepearate , from number
8 Answers
+ 3
strtok() function works for strings only and returns pointer to first character of the new string or NULL otherwise.(you can see the details in strcat() documentation)
But if you want to take floating point numbers seperated by a comma as input then you can easily do something like this👇
https://code.sololearn.com/c7p6eKplg9gS/?ref=app
+ 5
You can use strtok() function to split the string like this👇
https://code.sololearn.com/caiXHJx2c1qz/?ref=app
+ 2
No, you have to split strings on your own.
+ 2
Arsenic ahha. May you explain the logic of the program?
+ 2
I want the input to be received two floats as 1.5 , 2
+ 2
It ok .Thankyou so much👍🏻👍🏻
+ 2
the above example is c style splitting. You can try this c++ approach of splitting if you want.
https://code.sololearn.com/ceVFQl77SUD0/?ref=app
+ 1
Flash it is ok thankyou



