I have tried a simple code for using fgets(), as gets() is no more used and don't know anything better to read character input from keyboard.
My code:

```
#include<iostream>
#include<cstdio>

using namespace std;

int main()
{
char a;
fgets(a, 100, stdin);
cout<<a;
return 0;
}

```

I got this error:

```
cpp:13:20: error: invalid conversion from 'char' to 'char*' [-fpermissive]
 fgets(a, 100, stdin);
                    ^
In file included from /usr/include/c++/7.2.0/cstdio:42:0,
                 from /usr/include/c++/7.2.0/ext/string_conversions.h:43,
                 from /usr/include/c++/7.2.0/bits/basic_string.h:6159,
                 from /usr/include/c++/7.2.0/string:52,
                 from /usr/include/c++/7.2.0/bits/locale_classes.h:40,
                 from /usr/include/c++/7.2.0/bits/ios_base.h:41,
                 from /usr/include/c++/7.2.0/ios:42,
                 from /usr/include/c++/7.2.0/ostream:38,
                 from /usr/include/c++/7.2.0/iostream:39,
                 from jdoodle.cpp:1:
/usr/include/stdio.h:564:14: note:   initializing argument 1 of 'char* fgets(char*, int, FILE*)'
 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
              ^~~~~

```

Then, I have tried 

```
#include<iostream>    
#include<cstdio>

using namespace std;

int main()
{
char *a;
fgets(a, 100, stdin);
cout<<a;
return 0;
}

```

But incurred another error.

It will be appreciated if anyone shows a better method other than using fgets() or solve the above matter.