the execution is allocation sized 4.
--- execution 001 ---
|0221DE60|
|0221DE64|
|0221DE68|
|0221DE6C|
|0221DE70|
|0221DE74|
|0221DE78|
|0221DE7C|
|0221DE80|
|0221DE84|
|0221DE88|
|0221DE8C|
|0221DE90|
|0221DE94|
|0221DE98|
...
--- execution 001 ---
*
int vDisplayController_002::create_img_buffer_print_its_adress (char* filename, int width, int height, int flag) { float* img_003 = NULL; FILE *fp; float* f; int i; fp = fopen ( (char*) filename, "wb" ); if (fp == NULL) { printf("file: %s is unstable for its open as wb.\r\n", filename ); exit(-1); } img_003 = (float*) malloc(sizeof(float*)*width*height); if (img_003 == NULL) { printf("img_003 is not memoried(allocated).\r\n"); exit(-1); } for(i=0; i<width*height; i++) { f = (float*)(img_003 + i ); fprintf( fp, "|%p|\r\n", f); } fclose(fp); }
about *i increment
- | - | - | in loop |
1 | (*i)++ | better for the value | better for the value |
2 | *i++ | ? | ? |
3 | i++ |
*
[1]
[2]
[3]