Scoping question in C

Henry Spencer henry-lqW1N6Cllo0sV2N9l4h3zg at public.gmane.org
Fri Jun 10 17:34:34 UTC 2005


On Fri, 10 Jun 2005, William Park wrote:
> But, if the static string lives for the duration of the program, then
> pointer to it should always be valid, no?  Eg.
> 	char *y;
> 	y = "something inside";
> 	return (y);
> Here, 'y' (or, what the function returns) should be valid for entire
> program.

Correct.

                                                          Henry Spencer
                                                       henry-lqW1N6Cllo0sV2N9l4h3zg at public.gmane.org

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list