故障错误解决
Trouble error solving
我是这个网站的新手,也是编程新手。我在大学里上过一门编程课,老师给了我们一个代码来清除错误。我有这个困难,并希望一些帮助,提前感谢!我遇到的主要问题是"loop_counter"answers"FunctionFoo"身份不明和int loop_counter = 1;期待一个';'
#include "stdafx.h"
int UpdateWeatherStation(void)
{
printf("Updating Weather Stationnn");
int foo = 5;
return foo;
}
void main(void)
{
printf("nTech104 Lab02nn")
int loop_counter = 1;
int xyz = FunctionFoo();
int hjk = FunctionFoo();
while (loop_counter<10)
{
printf("Loop #:%dn", loop_counter);
int weatherStatus = UpdateWeatherStation();
printf("weatherStatus=%dn", weatherStatus);
printf("nn");
int user_input = getchar();
if (user_input == '5')
{
printf("User entered 5!!!!!n");
}
loop_counter++;
}
}
int FunctionFoo(void)
{
printf("Hellonn");
int abc = 5;
return abc;
}
你的代码充满了错误:
1-函数FunctionFoo的原型在哪里?
2-在main中printf()之后,语句';'结束在哪里?
#include <stdio.h>
int FunctionFoo(void);
int UpdateWeatherStation(void);
void main(void)
{
printf("nTech104 Lab02nn");
int loop_counter = 1;
int xyz = FunctionFoo();
int hjk = FunctionFoo();
while (loop_counter<10)
{
printf("Loop #:%dn", loop_counter);
int weatherStatus = UpdateWeatherStation();
printf("weatherStatus=%dn", weatherStatus);
printf("nn");
int user_input = getchar();
if (user_input == '5')
{
printf("User entered 5!!!!!n");
}
loop_counter++;
}
}
int FunctionFoo(void)
{
printf("Hellonn");
int abc = 5;
return abc;
}
int UpdateWeatherStation(void)
{
printf("Updating Weather Stationnn");
int foo = 5;
return foo;
}
相关文章:
- 如何解决错误:SCIP C++中的 SCIP 阶段无效 <10>
- 解决错误:运算符 [] 不匹配
- 开发如何解决错误193:%1不是Dev C 中的Win32应用程序
- 我该如何解决错误,说明创建图形对象没有放置在图形场景中
- 如何解决错误 C2719 在 Visual Studio 2010 C++ 中不存在代码行时
- 如何在C++中使用 ZeroMQ 发送包含数组的结构时解决错误
- 使用strupr和strlwr时如何解决错误"invalid conversion of char to char*"?
- Eigen SparseLU解决错误读取访问冲突,这>m_sup_to_col被0x111011101110112
- 如何解决错误:在Mac上令牌"("之前缺少二进制运算符?
- 如何解决错误:从" int* "到" int "的转换无效
- 如何解决错误PRJ0002:错误结果 -1073741515从"cl.exe"返回?
- 如何解决错误LNK2019:未解析的外部符号
- 解决错误的一般方法:变量周围的堆栈'x'已损坏
- 如何在Xcode中将长双精度转换为字符串格式?或如何解决错误"use of undeclared identifier 'to_string' "
- Eclipse conio.h正在解决错误
- 需要帮助解决错误 C2664
- 如何解决错误LNK2019:未解析的外部符号
- 如何解决错误:LNK2019:未解析的外部符号"public"?
- 无法解决错误LNK2019:未解析的外部符号
- 如何解决错误C2039