fatal error?

lidajun0717 lidajun0717 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

#include <iostream>
#include<cstring>
using namespace std;

const char map[] = {2, 2, 2, 3, 3, 3, 4, 4, 4,
5, 5, 5, 6, 6, 6, 7, 0, 7,
7, 8, 8, 8, 9, 9, 9};

typedef char (*Tel)[16];

int Deal(Tel telephone, Tel result, int count[], int nCases);
void Output(Tel result, int count[], int nCount);

int main()
{
int nCases;
int index = 0;
cin >> nCases;
Tel telephone = new char[nCases][16];
Tel result = new char[nCases][16];
int *count = new int[nCases];

char temp[16];
while (index < nCases)
{
cin >> temp;
strcmp(telephone[index++], temp);
}

int nCount = Deal(telephone, result, count, nCases);
Output(result, count, nCount);

delete []count;
delete []telephone;
delete []result;
return 0;
}

int Deal(Tel telephone, Tel result, int count[], int nCases)
{
char temp[16];
int nCount = 0;
temp[8] = '\0';
for (int i = 0; i < nCases; i++)
count[i] = 0;

for (int i = 0; i < nCases; i++)
{
int len = strlen(telephone[i]);
int k = 0;
int j;
for (j = 0; j < len; j++)
{
if (telephone[i][j] != '-')
temp[k++] = map[telephone[i][j]-'A'];
if (k == 3)
temp[k++] = '-';
}

for (j = 0; j < nCount; j++)
if (strcmp(temp, result[j]) == 0)
{
count[j]++;
break;
}

if (j == nCount) {
strcpy(result[nCount++], temp);
count[nCount-1]++;
}
}

return nCount;
}

void output(Tel result, int count[], int nCount)
{
for (int i = 0; i < nCount; i++)
cout << result[i] << " " << count[i] << endl;
}


1>1001.obj : error LNK2019: 无法解析的外部符号 "void __cdecl Output(char (*)[16],int * const,int)" (?Output@@YAXPAY0BA@DQAHH@Z),该符号在函数 _main 中被引用

用的是vs2010~~~
...全文
评论 3
收藏 已收藏
分享
返回顶部
lidajun0717
C++ 语言 65,214 成员 250,514 内容