본 웹 사이트를 처음 사용하고 프로그래밍에 익숙하지 않습니다. 나는 대학에서 프로그래밍 수업을 듣고 있으며 오류를 피할 수있는 코드를 받았다. 나는 이것으로 어려움을 겪고 있으며 사전에 도움을 청한다. 내가 가지고있는 주된 문제는 "loop_counter"와 "FunctionFoo"가 정체 불명이며 int loop_counter = 1; 기대하는 ';'문제 해결 오류
#include "stdafx.h"
int UpdateWeatherStation(void)
{
printf("Updating Weather Station\n\n");
int foo = 5;
return foo;
}
void main(void)
{
printf("\nTech104 Lab02\n\n")
int loop_counter = 1;
int xyz = FunctionFoo();
int hjk = FunctionFoo();
while (loop_counter<10)
{
printf("Loop #:%d\n", loop_counter);
int weatherStatus = UpdateWeatherStation();
printf("weatherStatus=%d\n", weatherStatus);
printf("\n\n");
int user_input = getchar();
if (user_input == '5')
{
printf("User entered 5!!!!!\n");
}
loop_counter++;
}
}
int FunctionFoo(void)
{
printf("Hello\n\n");
int abc = 5;
return abc;
}
loop_counter 오류는 드문 일이 아닙니다. 그 라인 앞뒤의 문장을주의 깊게 살펴보면 뭔가 빠졌음을 알 수 있습니다. –
또한 UpdateWeatherStation 함수의 위치와 FunctionFoo의 위치를 호출 위치와 비교하여주의 깊게 살펴보십시오. –
FunctionFoo의 프로토 타입은 어디에 있습니까? – Raindrop7