char * CutString(const char * str1) { char str2[4]; strncpy(str2, str1, 3); str2[3] = '\0'; //1 return str2; } int main() { char * s = CutString("aaaaaaa"); std:cout<<(s); }
Login in to like
Login in to comment
or Read more about C++ Quizzes
Login in to like
Login in to comment