POPMUISE
#include <stdio.h>/***** dest - 目标buff*** src - 源数据*** len - 获取源数据左边的数据个数**/char *getLeftX(char *dest, const char *src, unsigned int len) {sprintf(dest, "%.*s", len, src);return dest;}int main() {char arr[] = "kalsdfjalsuqiowernalkfasf";char arr2[256];int i;for (i=1; i<sizeof(arr); ++i)puts(getLeftX(arr2, arr, i));}