使用しているデバッガー(VisualC++およびBloodshedDevC ++)で、入力されるはずのコード行などをスキップするだけのコードに問題があります。コードは次のとおりです。
for(x = 0; x < TASKLIMIT; ++x)
{
cout<<"Enter the name of a task: ";
getline(cin, task[x].name);
cout<<"Enter the priority of the task: ";
cin>>task[x].priority;
while (task[x].priority > 10 || task[x].priority < 1)
{
cout<<"Enter a number from 1-10: ";
cin>>task[x].priority;
}
cout<<"Enter the estimated completion time of the task: ";
cin>>task[x].completion;
cout<<"Enter the deadline of the task: ";
cin>>task[x].deadline;
}
問題は時々最初にラインを動かしますそれはラインにありました
cin>>task[x].deadline;
その後、次の場所に移動しました。
getline(cin, task[x].name);
forループの2回目の反復に到達したとき
助けていただければ幸いです