在c++中,一般人只知道foreach分开写为“for each”时的用法,却不知道“foreach”的用法。不多说,直接上代码。
QStringList listTemp; listTemp.append("aaa"); listTemp.append("bbb"); listTemp.append("ccc"); QString strTemp1; QString strTemp2; foreach(strTemp1,listTemp) { strTemp2= strTemp1; }
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/201450.html原文链接:https://javaforall.net
