gpt4 book ai didi

c++ - 编译时 Unresolved external symbol 错误

转载 作者:行者123 更新时间:2023-11-30 03:44:27 25 4
gpt4 key购买 nike

<分区>

当我尝试编译它时,我收到一条错误消息

 unresolved external symbol "void __cdecl showarray(int * const,int)"

我不确定我做错了什么?我该怎么办,我的代码是这样的

#include<iostream>
#include<string>

using namespace std;


void sortArray(int [], int );
void showarray(int [],int );

int main(){
int endtime[10] = { 70, 38, 8, 101, 11, 127, 313, 14, 16, 127 };

cout << "unsorted" << endl;
showarray(endtime, 10);

sortArray(endtime, 10);

cout << "the sorted value are :" << endl;
showarray(endtime, 10);

return 0;
}

void sortArray(int array[], int size){
bool swap;
int temp;

do{
swap = false;
for (int count = 0; count < (size - 1); count++){
if (array[count] > array[count+1]){
temp = array[count];
array[count] = array[count + 1];
array[count + 1] = temp;
swap = true;
}
}
} while (swap);
}

void showarray(const float array[], int size){
for (int i = 0; i < size; i++)
cout << array[i] <<" "<< endl;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com