Go Down

Topic: help with alarm code (Read 4 times) previous topic - next topic

AWOL

Why ask me? What does the compiler say?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

copachino


Why ask me? What does the compiler say?


cos you maybe know where im mistaking but you want me to learn not that someone writes my code...

Code: [Select]
SimplePost.ino: In function 'void loop()':
SimplePost:50: error: cannot convert 'char (*)[9]' to 'char*' in assignment
SimplePost:55: error: cannot convert 'char (*)[9]' to 'char*' in assignment
SimplePost:60: error: cannot convert 'char (*)[11]' to 'char*' in assignment
SimplePost:66: error: cannot convert 'char (*)[10]' to 'char*' in assignment
SimplePost:71: error: cannot convert 'char (*)[10]' to 'char*' in assignment
SimplePost:75: error: cannot convert 'char (*)[9]' to 'char*' in assignment

Chaul


you mean something like this???

Code: [Select]
char* msg;

Is that what you tried and got all those errors? It looks most correct for what you seem to be trying to do. It's a pointer. Initialize it to 0 just in case.

Next you need to see what code sits on the line number it whines about, if it still does. I suspect the error messages point to all the lines where you are trying to assign something to msg and that's what you tinker. I can't tell off the top of my head at this hour what's it supposed to read for what you are doing there. I assume you are trying to assign the other array pointers to the msg one, so do that.

It's only going to work if twitter.post(msg) accepted a char pointer. I can see it takes a const char pointer judging by the error message. Well, see what the compiler tells you anyways without making too many changes at once between each compilation.

Another thing, if you end up getting a whole bunch of text posted (all of the strings), you probably need a null ending character \0 at the end of the string of characters. Or maybe not, I forget as I rarely have to deal with char arrays in C these days. Can you find out and post your findings?

AWOL

Code: [Select]
*msg =& str1;

The type of "*msg" is "char", but you're trying to assign an address to it.
That's why the compiler is upset.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Arrch

Edit: I'm behind the times.
   

Go Up