Volatile function

前端 未结 2 861
粉色の甜心
粉色の甜心 2021-02-13 01:36

Summary: What does the keyword volatile do when applied to a function declaration in C and in C++?

Details:

I se

2条回答
  •  长情又很酷
    2021-02-13 02:34

    foo() is not volatile.

    It's a function that returns a volatile int.

    Which is legal. But strange for a returned int.

    Member functions, on the other hand, can be volatile for the same reason they can be const -- both describe the object this is pointing to.

提交回复
热议问题