Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <string.h>
- #include <string>
- using namespace std;
- char* convert(int n)
- {
- string s = to_string(n);
- char* converted = new char[s.length() + 1];
- strcpy(converted, s.c_str());
- cout << converted;
- return converted;
- }
- int main()
- {
- int chislo;
- cin >> chislo;
- char *nechislo = convert(chislo);
- cout << nechislo;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment