I am getting error : ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] Can anyone please help me in resolving this error ??? Here is my code......
#include<iostream>
#include<string.h>
#include<conio.h>
#include<ctype.h>
using namespace std;
void main()
{
char *ptr[4] = {"books","television","computer","sports"};
char str[10];
cout << "Enter your favourite liesure pursuit : ";
cin >> str;
for(int a=0;a<4;a++)
{
if(!strcmp(str,ptr[a]))
{
cout << "Your favourite pursuit is available here \n";
}
else
{
cout << "\n Yopr favourite pursuit isn't available here \n";
}
getch();
}
}