Quantcast
Channel: User Peter - Reinstate Monica - Stack Overflow
Viewing all articles
Browse latest Browse all 243

Comment by Peter - Reinstate Monica on C: handle pointer to subset of array as small array

$
0
0
I wonder whether double (*smallarr_ptr)[10] = &bigarr[297]; is defined behavior because there is no array of 10 elements there. There are (ideally) 10 elements, but that's a different matter. Syntactically it would also need a cast in C++ (C is probably more lenient, but it should produce a warning with a sufficiently high warning level): double (*smallarr_ptr)[10] = (double (*)[10])&bigarr[297];.

Viewing all articles
Browse latest Browse all 243

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>