Mega Code Archive

 
Categories / C / Pointer
 

Using sizeof and pointer arithmetic

#include <iostream> #include <stddef.h> using namespace std; int main( ) {  float fvalues[] = {15.38,12.34,91.88,11.11,22.22};  float *pf;  size_t fwidth;  pf = &fvalues[0];  fwidth = sizeof(float);  pf = pf + fwidth; }