नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'type' : top-level volatile in cast is ignored
Remarks
The compiler detected a cast to an r-value type which is qualified with volatile, or a cast of an r-value type to some type that is qualified with volatile. According to the C standard (6.5.3), properties associated with qualified types are meaningful only for l-value expressions.
Example
The following example generates C4197:
// C4197.cpp
// compile with: /W3
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
void sigproc(int);
struct S
{
int i;
} s;
int main()
{
signal(SIGINT, sigproc);
s.i = 1;
S *pS = &s;
for ( ; (volatile int)pS->i ; ) // C4197
break;
// for ( ; *(volatile int *)&pS->i ; ) // OK
// break;
}
void sigproc(int) // ctrl-C
{
signal(SIGINT, sigproc);
s.i = 0;
}