Skip to content

Commit 76c984d

Browse files
committed
Add 3
1 parent 62c6763 commit 76c984d

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

function_pointers/3-main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ int main(int argc, char *argv[])
2424
num2 = atoi(argv[3]);
2525
op = argv[2];
2626

27-
if ((*op != '+') && (*op != '-') && (*op != '/') && (*op != '%') &&
28-
(*op != '*'))
27+
if (get_op_func(op) == NULL || op[1] != '\0')
2928
{
3029
printf("Error\n");
3130
exit(99);

function_pointers/calc

16.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)