GZEROQ
GZEROQ
采纳率0%
2017-10-13 04:13

LNK2019 无法解析的外部符号 小白求助哪里错了怎么修改啊

#include
using namespace std;
#include
struct stringy {
char * kk;
int ct;
};
int set(stringy &f, const char* str);
void show(const stringy &f, int n = 1);
void show(char* qq, int n = 1);
int main()
{
stringy beany;
char testing[] = "Reality isn't what it used to be.";
set(beany, testing);
show(beany);
show(beany, 2);
testing[0] = 'D';
testing[1] = 'u';
show(testing);
show(testing, 3);
show("Done!");
system("pause");
return 0;
}
int set(stringy &f, const char* str)
{
int count = 0;
for (int i = 0; str[i] != '\0'; i++)
{
f.kk[i] = str[i];
count = i + 1;
}
return count;

}

void show(const stringy &f, int n)
{
for (int i = 0; i<n; i++)
cout << f.kk << endl;

}
void show(const char* qq, int n)
{
for (int i = 0; i<n; i++)
cout << qq << endl;
}

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • caozhy 回答这么多问题就耍赖把我的积分一笔勾销了 4年前

    show("Done!");
    c++里这么写,done是string

    const char * s = "done";
    show(s);

    点赞 评论 复制链接分享

为你推荐