C++问题 error C2244

2024-11-30 10:43:43
推荐回答(2个)
回答1:

改好了,自己看吧。主要是字符数组初始化的问题,记住只有在定义字符数组的时候才可以用字符串给字符数组赋值。还有一个拼写错误,我也改过来了
#include
#include

using namespace std;

int main(int argc, char *argv[])
{
int number(0);
double number1(0);
double number2(0);
struct Convert
{
char convert_name[100];
double convert_rate;
};
Convert convert[3] = {{{"yuan to dollar"},0.125},{"dollar to pound",2},{"yuan to pound",0.0625}};
cout<<"choose a way to convert money"<cin>>number;
cout<<"please enter the type that you want to convert";
cin>>number1;
if(number<3&&number>=0)
number2=number1*convert[number-1].convert_rate;
else
cout<<"sorry ,you entered a wrong number";
cout<
system("PAUSE");
return EXIT_SUCCESS;
}
还不错,希望你采纳。

回答2:

函数定义写错了。


templatevoid SeqList::Bubblesort()
templatevoid SeqList::Printlist()
改成
template
void SeqList::Bubblesort()
template
void SeqList::Printlist()