Variable into char array


hi,
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&egrave;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: \"
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

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support