C: Does the address operator (&) produce a pointer (address + type) or just an address?

后端 未结 4 1322
感动是毒
感动是毒 2021-01-14 23:30

Most of what I\'ve read about the address operator, &, says it\'s used to get just that - an address. I recently heard it described differently, though, as

4条回答
  •  逝去的感伤
    2021-01-14 23:39

    No type awareness in C. C does not check for type safety. Even if you assign some improper address (such as &char to int *), it would only give warning that you are wrong. It won't cause any error.

提交回复
热议问题