Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char toChar(string data)
- {
- // Data
- const int theSize = data.size();
- char *pd = new char[data.size() + 80];
- strcpy(pd, data.c_str());
- //delete [] pd;
- return *pd;
- }
- int main ()
- {
- string input;
- getline(cin,input);
- //int theSize(input.size());
- int theSize(sizeof(input)+2);
- cout << theSize << endl;
- char *theBox = new char[theSize];
- string *tbin = new string;
- while(theSize != 0)
- {
- memcpy(tbin,input.c_str(),theSize);
- theBox[theSize] = toChar(*tbin);
- *tbin = "";
- theSize = theSize - 1;
- }
- getline(cin,input);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement