Quote Originally Posted by WoodSTokk
Undefined Behavior! You return a pointer to 'text', but 'text' is a local variable inside the function 'eingabe'.
At the time the function returns, the variable (and its space in memory) become invalid.
So the pointer points to a invalid memory.
You are confusing with something. The function input () returns the value contained in the local variable "text" to the global variable "text". This value is then processed further in the function laenge ().

Local variables are always temporary within a function, and thus their content. As soon as the function is left, this variable virtually no longer exists. This does not matter here, because each time the program is called, the local variable 'text' is initialized with a new value.

Nothing and nobody shows points to on an invalid memory area.