gets not a C11 standard, superceded by fgets

This commit is contained in:
Krishna Vedala 2020-04-08 09:45:12 -04:00
parent 1b826807ed
commit 1d8d07efc9
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7
1 changed files with 88 additions and 87 deletions

View File

@ -4,13 +4,14 @@
int main()
{
char hex[17];
#define MAX_STR_LEN 17
char hex[MAX_STR_LEN];
long long octal, bin, place;
int i = 0, rem, val;
/* Input hexadecimal number from user */
printf("Enter any hexadecimal number: ");
gets(hex);
fgets(hex, MAX_STR_LEN, stdin);
octal = 0ll;
bin = 0ll;