[討論] struct a.b([1:5]).c=1; 為什麼錯?

作者: s4300026 (s4300026)   2015-06-29 17:34:40
如題
我想要做到
a.b(1).c = 1
a.b(2).c = 1
a.b(3).c = 1
a.b(4).c = 1
a.b(5).c = 1
就很順手的打
a.b([1:5]).c=1;
然後就得到
Insufficient outputs from right hand side to
satisfy comma separated list expansion on left hand
side. Missing [] are the most likely cause.
該怎麼改成正確呢?
作者: celestialgod (天)   2015-06-29 17:36:00
field不能這樣操作
作者: s4300026 (s4300026)   2015-06-29 17:41:00
所以此題無解 只能用for了?
作者: celestialgod (天)   2015-06-29 17:47:00
用cell轉比較快看下面回文

Links booklink

Contact Us: admin [ a t ] ucptt.com