- #include <cstring>
- #include <cstdlib>
- using namespace std;
- int main() {
- char *name;
- name = (char *) malloc(100); /* allocate 100 byte buffer */
- strcpy(name, "hello"); /* copy the bytes of "hello" into the buffer */
- free(name); /* free the buffer */
- return 0;
- }