[英]expected ';' after top level declarator
i'm having the following error: expected ';'我有以下错误:预期';' after top level declarator在顶级声明符之后
and i'm not too sure what's wrong with the line of code.我不太确定这行代码有什么问题。 I'd really appreciate whatever help and assisatance that i am provided with.我真的很感激我提供的任何帮助和帮助。 In particular, this is extrcted from a problem set.特别是,这是从问题集中提取的。
#include <cs50.h>
#include <stdio.h>
int get_positive_int(string prompt);
string hash_table(int)
int main(void)
{
int i = get_positive_int("Positive Integer: ");
printf("%i\n", i);
}
// Prompt user for positive integer
int get_positive_int (string prompt)
{
int n;
do
{
n = get_int("%s", prompt);
}
while (n <0 || n > 8);
return n;
}
string hash_table(int)
{
for (int i = 0; i < n; i++)
{
printf("#");
}
printf("\n");
}
You are missing a ;
你缺少一个;
at the end of line 5.在第 5 行的末尾。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.