fatal error?
#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~~~
...全文
相关推荐
最常见的VC++编译错误信息_fatal_error
最常见的VC++编译错误信息_fatal_error
Fatal error: Call to undefined function curl_init()解决方法
Fatal error: Call to undefined function curl_init()解决方法
帝国CMS使用中常见的英文错误提示介绍与解答
一些常见的英文错误提示介绍如下
IAR常见错误详解IAR常见错误列表
IAR常见错误列表IAR常见错误列表IAR常见错误列表IAR常见错误列表
Carla运行的时候过了一会提示fatal error
如何解决Carla运行不了的问题


