主函数返回后,我收到分段错误.我已经注释掉了屏幕上显示的最后一项下面的所有内容.那是没用的.因此,我不知道该怎么办,因为它似乎没有被破坏,我肯定不会超出我的任何数组,因为我很确定我检查过.任何帮助都会很棒.谢谢,乔
我的代码是:(抱歉格式化,即使我使用了指定的4个空格,这个网站也搞砸了.)
#include<iostream>
#include<ctime>
#include<cstdlib>
#include<fstream>
#include<string>
using namespace std;
//Precondition: The List array has been broken down as far as possible.
//The integer arrays start, mid, and end indicate the position in the
//list array that is being merged back together in sorted order.
//The length variable indicates the length of the list array.
//This function combines the pieces of the array that were split apart
//in sorted order.
//Postcondition: It will return a completely sorted list as one …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用在用户空间中执行所花费的时间来计算我的C++程序的功能.我从程序内部尝试了clock_gettime(CLOCK_PROCESS_CPUTIME_ID,&start)命令,但我担心这是CPU时间而不是我实际需要的用户时间.时间"程序名称"在这种情况下不起作用,因为我只计时功能.任何帮助都会很棒.谢谢!