what is the problem in arduino
C:\Users\swartwq\Desktop\zx\sketch_jun06e\sketch_jun06e.ino:12:33: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
what is the problem in arduino
C:\Users\swartwq\Desktop\zx\sketch_jun06e\sketch_jun06e.ino:12:33: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
In C++
char* a = "a"; //invalid
const char* b = "b"; // valid
char c[] = "c"; //valid
The reason why the first line is invalid is that a
is a pointer to static read-only data and therefore is wrong to be non-const. C on the other hand is ok because the string "c" is allocated immediately on the stack and can therefore be changed.