Variable into char array
hi,
i want make char array analog read, i've problem "operand +".
i have this:
and error code is:
do want me ?
i want make char array analog read, i've problem "operand +".
i have this:
code: [select]
progmem prog_char content_page1[] = "<hr /><table border='1'><tr><th>" + analogchan0 + "</th><th>" + valeuranalog0 + "</th><th>volts</th></tr><tr><th>" + analogchan1 + "</th><th>" + valeuranalog1 + "</th><th>ampères</th></tr><tr><th>" + analogchan2 + "</th><th>" + valeuranalog2 + "</th><th>watts</th></tr><table>";
and error code is:
quote
multipage:62: error: invalid operands of types 'const char*' , 'const char [10]' binary 'operator+'
do want me ?
a double quote close string.
so this: "hello" world" string "hello" world" hanging around.
to double quote string, use escape character: \"
you can not variable in progmem (programmed along sketch code in flash) area.
you have runtime in sketch.
for example use $1 or %a in html code in progmem, , replace variables in sketch.
so this: "hello" world" string "hello" world" hanging around.
to double quote string, use escape character: \"
code: [select]
char message[] = "a text double quotes: \"hello world\". ";
you can not variable in progmem (programmed along sketch code in flash) area.
you have runtime in sketch.
for example use $1 or %a in html code in progmem, , replace variables in sketch.
Arduino Forum > Using Arduino > Programming Questions > Variable into char array
arduino
Comments
Post a Comment