~cpp
#include <cstdlib>
#include <iostream>

using namespace std;

 

void copy(char *src, char *dest, int length )
{
	
	for(size_t i(0);i<length; i++ )
	{
		dest[i] = src[i];
	}
	

}

 

int main () 

{

             //char *p = malloc(sizeof(char)*100);
			char *p = new char[30];

            copy("my_string", p, 30 );
		

            delete [] p;

			 return 0;

}
Retrieved from http://wiki.zeropage.org/wiki.php/05학번
last modified 2021-02-07 05:22:04