所以当我写一个函数
void sort (int oldarray[], int length)
{
//imagine there is a function here that runs a loop and finishes with a sorted:
newarray[];
}
如何让 newarray[] 替换主函数中的 oldarray[],如下所示:
int main()
{
int length = 7
int oldarray[length]
//here would be a loop that populates the oldarray
sort(oldarray[], length)
//a loop that prints the newarray[] from the sort or main function
}
仅供参考,这不是家庭作业。我是在自学,所以你不会帮我骗取教授的血汗钱。