Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <sstream>
- using namespace std;
- int atoi(const char* value,int base){
- stringstream strValue;
- strValue << value;
- unsigned int intValue;
- strValue >> intValue;
- int m1;
- int m2;
- int m3;
- m1 = intValue % base;
- intValue/=base;
- m2 = intValue % base;
- intValue/=base;
- /*m3 = intValue % base;
- intValue/=base; */
- int szam = m1+m2*10+m3*100;
- return szam;
- }
- int main()
- {
- int x = atoi("128",2);
- cout << x << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement