Ok, I have googled for the past 2 days and still have no answer to what I would think is an easy question.
I have values, predetermined from other parts of code, and I wish to combine them all into a single char, but have yet to find anywhere that will explain how to combine text together.
In the end, I wish to have,
char timestamp = ("2015-07-01 WED 12:31 ");
This above line is used to write to a log file that I am using for another project.
I have values:
year = 2015 month = 7 monthday = 1 weekday = 4 hour = 12 minute = 31
I wish to take all these values and combine them all together to make a char string. But what I have tried does not work at all.
timestamp = (year, "-", month, "-", monthDay, " ", weekDay, " ", hour, ":", minute, " ");
That gives me bracket errors.
I have tried to build it as a string array:
String timestampbuild; timestampbuild = (year, "-", month, "-", monthDay, " ", weekDay, " ", hour, ":", minute, " "); timestampbuild.toCharArray(timestamp, 27);
But that just ends up with a Screen.println =
How can I combine all the values that are already determined into a char array?