C++,如何把一个文本里的单词一个个存入数组结构?
文本是这样的:wheniwakeuptheothersideofthebediscoldmyfingersstretchoutseekingprimswarmthbutf...
文本是这样的:
when i wake up the other side of the bed is cold my
fingers stretch out seeking prims warmth but finding
only the rough canvas cover of the mattress she
must have had bad dreams and climbed in with our
mother of course she did this is the day of the
reaping
i prop myself up on one elbow theres enough light in
怎么实现这个: arry[0].word = when array[1].word = I array[2].word=wake
我试着用了getline: while(getline(ifs,useless,' ')
但是这样的话会把很多空格,换行一起录入进去,有没有办法只单单录入单词? 展开
when i wake up the other side of the bed is cold my
fingers stretch out seeking prims warmth but finding
only the rough canvas cover of the mattress she
must have had bad dreams and climbed in with our
mother of course she did this is the day of the
reaping
i prop myself up on one elbow theres enough light in
怎么实现这个: arry[0].word = when array[1].word = I array[2].word=wake
我试着用了getline: while(getline(ifs,useless,' ')
但是这样的话会把很多空格,换行一起录入进去,有没有办法只单单录入单词? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询