예제 #1
0
파일: shortStr.c 프로젝트: lshuoz/myDemo
int main(int argc, char **argv){
    char longstr[] = "aedclkfcbdacbcd";
    char shortstr[] = "abc";
    char *dst = calloc(strlen(longstr), sizeof(char));
    if(shortStr(longstr, shortstr, dst))
        printf("%s\n", dst);
    free(dst);
    return 0;
}
예제 #2
0
// method to convert stringw to std::string
std::string ZoneSoundLoader::getStringFromWString(stringw str){
	stringc shortStr(str);
	std::string fileNameToStr(shortStr.c_str(), shortStr.size());
	return fileNameToStr;
}