Monday, January 16, 2012

Resolving Warning: warning: deprecated conversion from string constant to ‘char*’

char *s = "hello";
This declaration will give the below warning message
warning: deprecated conversion from string constant to ‘char*’
 
To resolve this use declaration as follows,
 
char *s = (char *) "hello";

No comments: