Top "Lifetime" questions

A variable's life-time is the time during which the variable is bound to a specific memory location.

What is the lifetime of a static variable in a C++ function?

If a variable is declared as static in a function's scope it is only initialized once and retains its value …

c++ static lifetime
How to set lifetime of session

How to set session lifetime in PHP? I Want to set it to forever as long as the request is …

php session lifetime
Connection Timeout and Connection Lifetime

What is the advantage and disadvantage of connection timeout=0? And what is the use of Connection Lifetime=0? e.g (Database=…

timeout connection connection-pooling lifetime
Is there any way to return a reference to a variable created in a function?

I want to write a program that will write a file in 2 steps. It is likely that the file may …

reference rust lifetime
How to Leverage browser caching at ASP.net IIS 7.5

The following cacheable resources have a short freshness lifetime. Specify an expiry of at least one week in the future …

caching browser iis-7 browser-cache lifetime
Why can't I store a value and a reference to that value in the same struct?

I have a value and I want to store that value and a reference to something inside that value in …

lifetime borrow-checker rust
What is the correct way to use lifetimes with a struct in Rust?

I want to write this structure: struct A { b: B, c: C, } struct B { c: &C, } struct C; The …

rust lifetime
Why are explicit lifetimes needed in Rust?

I was reading the lifetimes chapter of the Rust book, and I came across this example for a named/explicit …

reference rust static-analysis lifetime
"Life-time" of a string literal in C

Wouldn't the pointer returned by the following function be inaccessible? char *foo(int rc) { switch (rc) { case 1: return("one"); case 2: …

c function local-variables string-literals lifetime
Dnspython: Setting query timeout/lifetime

I have a small script that checks a large list of domains for their MX records, everything works fine but …

python timeout lifetime dnspython