ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Пятница
19 июля
660788 Топик полностью
il-2 (17.03.2016 12:28, просмотров: 122) ответил йцукен на А я всегда через преобразование типа указателя делал. Не поручусь, что соответствует стандарту, но вроде работает.
Походу, у тебя правильный подход, и в стандарте про это пишут: 6.7.3 Type qualifiers ... A cast of a value to a qualified type has no effect; the qualification (volatile, say) can have no effect on the access since it has occurred prior to the cast. If it is necessary to access a nonvolatile object using volatile semantics, the technique is to cast the address of the object to the appropriate pointer-to-qualified type, then dereference that pointer.