I am porting some C code to C++ right now. The C code is using multiple defines like:
#define IPADDRESS "fd9e:21a7:a92c:2323::1"
The problem that i have is that when i am calling C functions with the defines that are now in the C++ file i get:
warning: ISO C++ forbids converting a string constant to ‘char*’
I don't want to modify the C functions in this case and since I am still new to C++ and i was wondering how to handle this problem. I guess it isn't possible to tell C++ to handle these defines as a char*
and not as a string constant
so i was wondering if it is safe to cast the string constant
to a char*
in this case or if there is a function that i should use for this?
I appreciate your help!