What does thread_local int errors; declare (C23; _Thread_local in C11)?
Thread storage duration gives every thread its own instance, created when the thread starts. It is how errno works safely in multithreaded programs.
C Variables · Exercise 1 of 4
Twelve multiple-choice questions on naming, initialisation, scope, lifetime, linkage and the storage classes – including thread_local and C23 auto. Pick an option to check your answer instantly.
What does thread_local int errors; declare (C23; _Thread_local in C11)?
Thread storage duration gives every thread its own instance, created when the thread starts. It is how errno works safely in multithreaded programs.
In C23, what is the type of x in auto x = 2.5f;?
With an initializer, C23's auto deduces the type: 2.5f is a float. Before C23 the line would have meant "automatic storage, implicit int", which C99 had already removed.
Timed online tests with instant scores and explanations.