Created
July 27, 2015 08:43
-
-
Save krysseltillada/d3416fa73bd7695f45aa to your computer and use it in GitHub Desktop.
exercise 9.5.1(a)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
int main () | |
{ | |
const size_t sz = 2; | |
char c_str[] = {'2', '3'}; | |
std::vector <char> c; | |
for (unsigned i = 0; i != sz; ++i) { | |
c.push_back (*(c_str + i)); | |
} | |
std::string str(c.begin(), c.end()); | |
std::cout << str << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment