Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    A "const global variable" is what I meant by global variable - it's the same thing. Commented Aug 13, 2021 at 17:10
  • 1
    Obviously I did read the documentation however clearly a few things were not completely clear - hence the question. Your comments clarified some of them. Commented Aug 13, 2021 at 17:13
  • 1
    By documentation I mean the info at en.cppreference.com btw Commented Aug 13, 2021 at 17:16
  • 2
    A const global variable is still different to a constant. Global variables can still have their address taken even if they're const and this yields a const*. Constants cannot. Commented Jun 24, 2022 at 13:04
  • C-style is especially useful if you are working in an embedded (or high-performance) environment. Commented Mar 2, 2023 at 20:03