我收到以下 C 程序的错误消息,该程序假设将字符串中的一个单词更改为大写字母。
1>verkefni06.obj : error LNK2019: unresolved external symbol _strhlt referenced in function _main
1>c:\kit\skilaverk06\Debug\skilaverk06.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
这是我到目前为止得到的代码,非常感谢任何导致代码工作的帮助。
#include <stdio.h>
#include <string.h>
#include <ctype.h>
pragma warning(disable : 4996)
pragma warning(disable : 4550)
/* strindex: return index of t in s, -1 if none */
/* getline: get line into s, return length */
int getline (char s[], int lim)
{
int c, i;
i = 0;
while (--lim > 0 && (c=getchar()) != EOF && c != '\n')
s[i++] = c;
s[i] = '\0';
return i;
}
/* strindex: return index of t in s , -1 if none */
int strindex (char s[], char t[])
{
int i, j, k;
for (i=0; s[i] != '\0'; i++){
for (j=i, k=0; t[k] != '\0' && s [j]==t[k]; j++, k++)
;
if (k > 0 && t[k] == '\0')
return i;
}
return -1;
}
int strhlt(char sz[], char szHigh[]);
main()
{
char sz [60];
strcpy;
getline (sz,60);
getline (sz, 60);
strhlt (sz,"write" );
getline ("%s",60);
printf("skrifadu stutta setningu (mest 60 stafabil): ");
printf("\n\nRitadu ordid sem breytist i hastafi (mest 10 stafi): %s", sz);
getchar();
return 0;
}