A string object initialized in a function appears empty in another.

I have a strange problem. Apparently the visibility of a String object changes from one function to another. I am developing the code for a Geiger counter with a Mega 2560. Optionally, the program allows Serial.println display through a line object is issued every minute using the serial monitor data, sending in a unique object using Serial.println values as date, time, temperature, humidity relative number of accounts in the last minute and microSieverts dose.
The information is composed in a String object initialized as “” concatenating values from anothers String object. When viewing the String object from the serial port, some values are concatenated as empty strings. However, within the function that generates the values are concatenated and displayed with Serial.println correctly. Anybody can help me?

See "scope". Or if that fails try posting your code!


Apparently the visibility of a String object

Then why did you say string in your post title. Strings and strings are two entirely different things. One is relevant on the Arduino. The other is Not.

How to use this forum