...runtime error(access_violation)拜托各位大神

发布网友 发布时间:2022-04-24 13:56

我来回答

1个回答

热心网友 时间:2022-04-11 20:45

runtime error(access_violation)是运行时错误,非法访问内存,比如数组越界或者堆栈溢出。 看看题目要求: Input contains multiple test cases. Each test case starts with a number N ( 0 < N <= 1000 ) -- the total number of balloons distributed. The next N lines contain one color each. The color of a balloon is a string of up to 15 lower-case letters. A test case with N = 0 terminates the input and this test case is not to be processed. 而你的程序: a=(char **)malloc( 10 *sizeof(char *)); 用个超过10个的case就越界了。

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com