标签:his bsp error 初始化 数组 class span col div
1. 如果不是以‘\0‘结尾的char数组,去初始化string时一定要带上长度;而以‘\0‘结尾的char数组,则不需要.
char no_null[] = {‘H‘, ‘i‘}; string str(no_null); //runtime error:not null-terminated. str: Hi烫烫烫hX? string str2(no_null, 2); char c_array[] = "Hi"; string str3(c_array); //this is right;
标签:his bsp error 初始化 数组 class span col div
原文地址:https://www.cnblogs.com/Stephen-Qin/p/12961939.html