{"id":866,"date":"2013-05-08T11:27:50","date_gmt":"2013-05-08T03:27:50","guid":{"rendered":"http:\/\/www.shizhiyou.com\/blog\/?p=866"},"modified":"2014-05-03T23:47:21","modified_gmt":"2014-05-03T15:47:21","slug":"vc%e5%a4%84%e7%90%86%e7%94%a8%e4%b8%80%e4%b8%aa%e7%89%b9%e5%ae%9a%e7%ac%a6%e5%8f%b7%e9%9a%94%e5%bc%80%e7%9a%84%e6%95%b0%e6%8d%ae%e6%96%87%e6%9c%ac%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/866","title":{"rendered":"vc++\u5904\u7406\u7528\u4e00\u4e2a\u7279\u5b9a\u7b26\u53f7\u9694\u5f00\u7684\u6570\u636e\u6587\u672c\u65b9\u6cd5"},"content":{"rendered":"

\u8fd9\u4e2a\u65b9\u6cd5\u6211\u4e00\u76f4\u5728\u7528\uff0c\u4f46\u662f\u4e00\u76f4\u6ca1\u6709\u641e\u660e\u767d\u4ed6\u7684\u539f\u7406\u3002\u4eca\u5929\u5728\u8fd9\u91cc\u597d\u597d\u5206\u6790\u4e00\u4e0b\u5427\u3002\u6211\u5728\u6e90\u7801\u4e2d\u6ce8\u91ca\u7684\u5f88\u8be6\u7ec6\u4e86\uff01\u8fd9\u6b21\u5206\u6790\u5047\u5b9a\u7528\u9017\u53f7\u505a\u5206\u9694\u7684\uff0c\u5176\u4ed6\u7684\u4e5f\u540c\u7406\uff0c\u7a7a\u683c\uff0c\u5192\u53f7\u7b49\u3002<\/p>\n

CString strText;\r\n\r\nCStringArray arr;\/\/\u7528\u6765\u653e\u5f97\u5230\u7684\u6570\u636e\u6bb5\uff0c\u8fd9\u662f\u4e00\u4e2a\u6570\u7ec4\r\n\r\nstrText =\"1\uff0c\u5f20\u4e09\uff0c\u7a0b\u5e8f\u5458\uff0c2013\u5e74\u5165\u804c\uff0cC++\";\/\/\u5047\u5b9a\u8981\u5206\u6790\u7684\u4e00\u884c\u6570\u636e\r\n\r\nwhile(1)\r\n{\r\n\tint pos = strText.Find(L\",\");\/\/\u6807\u8bb0\u51fa\u627e\u5230\u7684\u7b2c\u4e00\u4e2a\u9017\u53f7\u5728strText\u4e2d\u7684\u4ee50\u4e3a\u521d\u59cb\u7d22\u5f15\u7684\u5e8f\u53f7\u3002\u627e\u4e0d\u5230\u8fd4\u56de-1\u503c\r\n\tif(pos >= 0)\r\n\t{\r\n\t\tarr.Add(strText.Left(pos)); \/\/\u628a\u5de6\u8fb9\u7684\u7b2c\u4e00\u6bb5\u653e\u5230\u6570\u7ec4\u4e2d\r\n\t\tstrText = strText.Mid(pos+1); \/\/\u628a\u9664\u7b2c\u4e00\u6bb5\u5269\u4e0b\u7684\u653e\u5230strText\u4e2d\r\n\t}\r\n\telse\r\n\t{\t\t\r\n\t\t\/\/\u627e\u4e0d\u5230\u9017\u53f7\uff0c\u8bf4\u660e\u8fd9\u662f\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u4e86\r\n\t\tarr.Add(strText);\r\n\t\t\/\/strText = \"\";\r\n\t\tbreak; \/\/\u8df3\u51fawhile\uff081\uff09\u5faa\u73af\uff01\r\n\t}\r\n}<\/pre>\n

ok\uff0cthat’s it\u3002\u6211\u53cd\u6b63\u662f\u660e\u767d\u4e86\u3002\u4f60\u5462<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8fd9\u4e2a\u65b9\u6cd5\u6211\u4e00\u76f4\u5728\u7528\uff0c\u4f46\u662f\u4e00\u76f4\u6ca1\u6709\u641e\u660e\u767d\u4ed6\u7684\u539f\u7406\u3002\u4eca\u5929\u5728\u8fd9\u91cc\u597d\u597d\u5206\u6790\u4e00\u4e0b\u5427\u3002\u6211\u5728\u6e90\u7801\u4e2d\u6ce8\u91ca\u7684\u5f88\u8be6\u7ec6\u4e86\uff01\u8fd9\u6b21\u5206\u6790\u5047\u5b9a\u7528\u9017\u53f7\u505a\u5206\u9694\u7684\uff0c\u5176\u4ed6\u7684\u4e5f\u540c\u7406\uff0c\u7a7a\u683c\uff0c\u5192\u53f7\u7b49\u3002 CString strText; CStringArray arr;\/\/\u7528\u6765\u653e\u5f97\u5230\u7684\u6570\u636e\u6bb5\uff0c\u8fd9\u662f\u4e00\u4e2a\u6570\u7ec4 strText =”1\uff0c\u5f20\u4e09\uff0c\u7a0b\u5e8f\u5458\uff0c2013\u5e74\u5165\u804c\uff0cC++”;\/\/\u5047\u5b9a\u8981\u5206\u6790\u7684\u4e00\u884c\u6570\u636e while(1) { int pos = strText.Find(L”,”);\/\/\u6807\u8bb0\u51fa\u627e\u5230\u7684\u7b2c\u4e00\u4e2a\u9017\u53f7\u5728strText\u4e2d\u7684\u4ee50\u4e3a\u521d\u59cb\u7d22\u5f15\u7684\u5e8f\u53f7\u3002\u627e\u4e0d\u5230\u8fd4\u56de-1\u503c if(pos >= 0) { arr.Add(strText.Left(pos)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,9],"tags":[144],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/866"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=866"}],"version-history":[{"count":5,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/866\/revisions"}],"predecessor-version":[{"id":1118,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/866\/revisions\/1118"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=866"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}