4

enter image description here

Some keywords are colored green automatically. What do those words mean? Are those keywords reserved for C++? Can I use those words as program variables?

2 Answers2

1

sizeof is an operator. You can't use it as an identifier.

size is a function in std::, and also a member of many classes in std::. You should use it as an identifier, if you are writing a Container type. It's fine to use it as an identifier elsewhere.

Caleth
  • 52,200
  • 2
  • 44
  • 75
0

sizeof is a keyword. size is not.

For a more comprehensive list have a look here.

super
  • 12,335
  • 2
  • 19
  • 29
  • This does not completely answer the question. The green words are STL-related ones. – André Caceres Mar 02 '20 at 13:13
  • 1
    @AndréCaceres It answers part of the question, namely *Are those keywords reserved for C++?*. Since I'm not familiar with CodeBlocks I just contributed the information I knew. If you can complement or improve on the answer please do, but if you downvote with the reasoning that my answer could be better, you should probably adjust your voting habits. – super Mar 02 '20 at 14:28