#include <cs50.h>
#include <stdio.h>
int main(void)
{
if (x<y)
{
printf ("x is less than y\n");
}
else if (x>y)
{
printf ("x is not less than y\n");
}
else
{
printf ("x is equal to y\n");
}
}
이렇게 입력하면
$ make if
clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow if.c -lcrypt -lcs50 -lm -o if
if.c:6:9: error: use of undeclared identifier 'x'
if (x<y)
^
if.c:6:11: error: use of undeclared identifier 'y'
if (x<y)
^
if.c:10:14: error: use of undeclared identifier 'x'
else if (x>y)
^
if.c:10:16: error: use of undeclared identifier 'y'
else if (x>y)
^
4 errors generated.
<builtin>: recipe for target 'if' failed
make: *** [if] Error 1
clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow if.c -lcrypt -lcs50 -lm -o if
if.c:6:9: error: use of undeclared identifier 'x'
if (x<y)
^
if.c:6:11: error: use of undeclared identifier 'y'
if (x<y)
^
if.c:10:14: error: use of undeclared identifier 'x'
else if (x>y)
^
if.c:10:16: error: use of undeclared identifier 'y'
else if (x>y)
^
4 errors generated.
<builtin>: recipe for target 'if' failed
make: *** [if] Error 1
이렇게 뜹니다. if는 사용할 수 없는 건가요?
comment