~/talk

What Is "Hello" in C++?

Talkat ACCU 2025 · 2025-04-01..04-04· [c-and-cpp]
slides:none on file

Shows that the literal "hello" has type const char[6] and a surprising value category: it behaves as an lvalue even though it often decays to const char* with `auto s = "hello"`. Uses `decltype`, `auto`, and references to demonstrate why `decltype("hello")` returns a reference type because `decltype` inspects the expression category, and highlights ChatGPT giving conflicting answers so the concrete rule about array decay and value categories is clarified.

AI-written summary · about

  1. 0:00Intro: What Is "Hello" in C++?
  2. 0:25Assigning "="hello" to Variables
  3. 1:00Const Char Arrays and Type Matching
  4. 1:45References and Expression Types
  5. 2:12What Is a Value Category?
  6. 2:55Lvalue vs Rvalue vs Xvalue
  7. 3:40ChatGPT's Conflicting Answers
  8. 4:30Understanding decltype("hello")
  9. 5:20Final Breakdown: Type and Value of "hello"
  10. 5:45Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.