#include<stdio.h>
#include<stdlib.h>
#define GYOU (7)
#define RETSU (11)
void val_set(double **p);
void val_show(double **p);
int main()
{
int i;
double **p1;
// alloc
p1
= (double **) malloc(sizeof(double *) * GYOU
); // ポインタの配列 p1
[0] = (double *) malloc(sizeof(double) * GYOU
* RETSU
); // 実際のデータ for (i = 1; i < GYOU; i++) {
p1[i] = p1[i - 1] + RETSU;
}
// access
val_set(p1);
val_show(p1);
// free
return 0;
}
void val_set(double **p)
{
int i, j;
for (i = 0; i < GYOU; i++) {
for (j = 0; j < RETSU; j++) {
p[i][j] = (double) i *100.0 + (double) j;
}
}
}
void val_show(double **p)
{
int i, j;
for (i = 0; i < GYOU; i++) {
for (j = 0; j < RETSU; j++) {
}
}
}
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8c3RkbGliLmg+CgojZGVmaW5lIEdZT1UgICAoNykKI2RlZmluZSBSRVRTVSAgKDExKQoKdm9pZCB2YWxfc2V0KGRvdWJsZSAqKnApOwp2b2lkIHZhbF9zaG93KGRvdWJsZSAqKnApOwoKaW50IG1haW4oKQp7CiAgICBpbnQgaTsKICAgIGRvdWJsZSAqKnAxOwoKICAgIC8vIGFsbG9jCiAgICBwMSA9IChkb3VibGUgKiopIG1hbGxvYyhzaXplb2YoZG91YmxlICopICogR1lPVSk7ICAgLy8g44Od44Kk44Oz44K/44Gu6YWN5YiXCiAgICBwMVswXSA9IChkb3VibGUgKikgbWFsbG9jKHNpemVvZihkb3VibGUpICogR1lPVSAqIFJFVFNVKTsgICAvLyDlrp/pmpvjga7jg4fjg7zjgr8KICAgIGZvciAoaSA9IDE7IGkgPCBHWU9VOyBpKyspIHsKICAgICAgICBwMVtpXSA9IHAxW2kgLSAxXSArIFJFVFNVOwogICAgfQogICAgLy8gYWNjZXNzCiAgICB2YWxfc2V0KHAxKTsKICAgIHZhbF9zaG93KHAxKTsKICAgIC8vIGZyZWUKICAgIGZyZWUocDFbMF0pOwogICAgZnJlZShwMSk7CgogICAgcmV0dXJuIDA7Cn0KCnZvaWQgdmFsX3NldChkb3VibGUgKipwKQp7CiAgICBpbnQgaSwgajsKCiAgICBmb3IgKGkgPSAwOyBpIDwgR1lPVTsgaSsrKSB7CiAgICAgICAgZm9yIChqID0gMDsgaiA8IFJFVFNVOyBqKyspIHsKICAgICAgICAgICAgcFtpXVtqXSA9IChkb3VibGUpIGkgKjEwMC4wICsgKGRvdWJsZSkgajsKICAgICAgICB9CiAgICB9Cn0KCnZvaWQgdmFsX3Nob3coZG91YmxlICoqcCkKewogICAgaW50IGksIGo7CgogICAgZm9yIChpID0gMDsgaSA8IEdZT1U7IGkrKykgewogICAgICAgIGZvciAoaiA9IDA7IGogPCBSRVRTVTsgaisrKSB7CiAgICAgICAgICAgIHByaW50ZigiJTA0LjBmICIsIHBbaV1bal0pOwogICAgICAgIH0KICAgICAgICBwcmludGYoIlxuIik7CiAgICB9Cn0K