Skip to content

Commit

Permalink
Fix get_int Bug on this test
Browse files Browse the repository at this point in the history
in line  6:
get_int must print a text as it's on cs50.h
" int get_int(const char *format, ...) __attribute__((format(printf, 1, 2))); "
  • Loading branch information
IslamAbdelslam authored Feb 19, 2023
1 parent 97bca13 commit 4a91d37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/get_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

int main(void)
{
int i = get_int();
int i = get_int("Enter a number:\n");
printf("%i\n", i);
int j = get_int("Foo: ");
printf("%i\n", j);
Expand Down

1 comment on commit 4a91d37

@IslamAbdelslam
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in line 6:
get_int must print a text as it's on cs50.h
" int get_int(const char *format, ...) attribute((format(printf, 1, 2))); "
at least
get_int("");
Thanks

Please sign in to comment.