// file: my first program // #include #include #include // my main program starts here // int main(int argc, char** argv) { long M = 10; float* y = new float[M*M]; memset(y, 0, M*M*sizeof(float)); y[M*1 + 1] = 27.0; y[M*2 + 2] = 99.0; float*z = y; long N = 3; for (long i = 0; i < N; i++) { for (long j = 0; j < N; j++) { fprintf(stdout, "y[%d][%d] = (%u) %f <> %u %f\n", i, j, &y[N*i+j], y[N*i+j], z, *z); z++; } } /* short int buf[10]; FILE* fp = fopen(argv[1], "r"); fprintf(stdout, "position = %u\n", ftell(fp)); fread(buf, sizeof(short int), 1, fp); fprintf(stdout, "position = %u\n", ftell(fp)); fclose(fp); /* void* pstr = (void*)new char[10]; char Joe[] = "JoePicone"; char* str = Joe; fprintf(stdout, "str = %c\n", str[0]); str++; fprintf(stdout, "str = %c\n", *str); double Mary[10]; Mary[0] = 27.0; Mary[1] = 35.0; Mary[2] = -27.0; double* psum = (double*)Mary; fprintf(stdout, "psum = %f\n", *psum); psum++; fprintf(stdout, "psum = %f\n", *psum); */ // exit gracefully // return 0; }