Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- ///includujemy stringowe strumyczki
- std::stringstream strumyk;
- ///strumyczek
- int main()
- {
- /// --- KONWERSJA STRING -> LICZBA( FLOAT, INT, LONG, itp. )
- float numbah;
- strumyk << "21.37";
- ///ladujemy do strumyka liczbe w postaci tekstu
- strumyk >> numbah;
- ///wyciagamy ze strumyka liczbe i nadajemy ja zmiennej numbah
- /// --- KONWERSJA LICZBA(J.W.) -> STRING
- std::string leet;
- int xd = 1337;
- strumyk << xd;
- ///ladujemy liczbe do strumyka
- leet << xd;
- ///i wyciagamy stringa
- std::cout << numbah;
- std::cout << xd;
- /// no i elo
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement