‘String’ is not recommended as it may cause memory problems; use a ‘char’ string instead.
I have extreme nightmares whit char sofar.
Probaly due too my poor code writing. Hence back to strings sofar. I havent tried yet as the kids have my pc under hostage just was wondering if that would be along the way u was recommanding.
i dont understand how the char works like i tried char name = "input" but i seem to not be able to make it like glue info together. i end up whit weird characters on my lcd.
i used code before.
but i either get 00 or 0 but the int doesnt glue.
current output on the leadzeros is: no digit, 0, or 00
i compare the strings to the old storage string. if i update screen or not.
example if(string1 != string1old or string2 != string2old) { //update screen
}
i am open to change to char. but if i turn the initial String to char it simply wont work as created here.
Description
Text strings can be represented in two ways. you can use the String data type, which is part of the core as of version 0019, or you can make a string out of an array of type char and null-terminate it. This page described the latter method. For more details on the String object, which gives you more functionality at the cost of more memory, see the String object page.
...
michielsweb:
problem seem fixed.
i got a other problem
maybe 1 can solve this.
i get 4 digits send to my arduino.
i split the digits
i change the digits.
now i want to glue them together again.
what would be the best way?
so lets say i start whit 1234
i split the digits . each int contains digits
is there a way i can glue them together again?
just to be clear:
currently i do this:
int income = "1234";
int digit1 = income / 1000 % 10;
int digit2 = income / 100 % 10;
int digit3 = income / 10 % 10;
int digit4 = income % 10;
// skipping processing codes to save length
// digit1,2,3,4 are changed..
now what is best way to glue digit 1 til 4 together again.?
Sorry but this doesn't work correctly either. An unsigned long is only 4 bytes and you need to account for the terminating null, and the double quotes have become single quotes.
If the single quotes were intentional, they should not be used around multiple characters.
Sorry but this doesn't work correctly either. An unsigned long is only 4 bytes and you need to account for the terminating null, and the double quotes have become single quotes.
If the single quotes were intentional, they should not be used around multiple characters.