I did a function that simulates what strncpy does in the string library. Copy a number of characters from one word into another. But I do not want to change the original string ... and it does. I can not find a way to not modify it. I pass the function:
char * mistrncpy(char * cad2,
const char * cad1, int cant) {
const char * cadaux1;
int i = 0;
for (cad2 = cad1; i < cant; i++);
if (i == cant) {
*(cad2 + i) = 'char * mistrncpy(char * cad2,
const char * cad1, int cant) {
const char * cadaux1;
int i = 0;
for (cad2 = cad1; i < cant; i++);
if (i == cant) {
*(cad2 + i) = '%pre%';
return cad2;
}
}
';
return cad2;
}
}