我想下面的代码,它失败,出现以下错误:文件input.txt中的 malloc: *** error for object 0x10000d8c0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Program received signal: “SIGABRT
好吧,所以我有getline的问题。 我有一个包含几个字符串的文件。我自己创建了它,并且我将每个字符串放在一条单独的行上。 Ex. textfile.txt
Line 1
Line 2
Line 3
Line 4
//Little snip of code
ifstream inFile("textfile.txt");
getlin