This piece of code I made copies the first 3 characters of the string ‘a’ into the string ‘b’ using the strncpy() function found in the string header file which you can include like this: #include <string>.
#include "DarkSDK.h"
#include <string>
void DarkSDK ( void )
{
dbPrint("Enter in a string:");
char* a = dbInput(); // get some keyboard input
char b[256]=""; // create a new array
strncpy(b,a,3); // copy the first 3 charactors of a into b
dbPrint("The first 3 charactors of a were copied into b: ");
dbPrint(b);
dbSuspendForKey(); // wait for a keypress
return;
}