Mixing formatted input extractors with getline causes cout display to stick together
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The following code seves to establish a movie database and query through it. It works as intended except for the first cout statements being clumped together. The code is as follows. // array of structures #include <iostream> #include <string> #include <sstream> #include <stdio.h> #include <cctype> using namespace std; #define NUM_MOVIES 6 //structure struct movies_iit{ string title; int year; } films [NUM_MOVIES]; //global variables char title [20], y, n; int year; string search; //function 1 void sort_on_title(movies_iit films[], int n) {