+ 1
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main() {
char a,b;
cout<<"enter the string";
gets(&a); //ptr
strcpy(b,a); //semi
strrev(b); //semi
if(strcmp(a,b)==0)
cout<<"string is palindrome";
else
cout<<"string is not palindrome";
return 0;
}
This doesnât completely solve the problem, but some errors fixed.
1. In C++, stdio does not exist. The header file is cstdio.
2. gets() needs a reference, not value. Nerds &a as parameter, not a.
3. strcpy() needs a semicolon.
4. strrev() needs a semicolon.
Some errors still exist, these are all the ones I could fix.