我必须创建一个程序,该程序具有一个接受三个参数的函数charster():一个字符和两个整数。它将打印字符输入x每y行数x次。我收到语法错误LNK2019和LNK1120 main中引用的未解决的外部符号。还有IDK我做了什么导致这种情况或采取了纠正措施。
这是我的代码:
#include <stdio.h>
void charster(char n,int n_char,int n_lines);
int main(void)
{
char n;
int n_lines,n_chars;
printf("Please enter a character to be printed,the amount of times it should appear,and the amount of lines that should appear: ");
while (scanf("%c,%d,%d",&n,&n_chars,&n_lines) == 3)
{
charster(n,n_chars,n_lines);
}
return 0;
void charster(char n,int n_lines);
{
int count;
for (count = 0; count < n_lines; count++)
{
putchar(n);
}
}
}