1 / 40

メモリ

俺でもわかるポインタ講座. メモリ. char c; int i; float f; double d; char str[5]; int tab[2];. char *cpr; int *ipr; float *fpr; double *dpr;. struct point{ int x; int y: }; struct point pt;. char **cppr;.

amos-young
Download Presentation

メモリ

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  2. 俺でもわかるポインタ講座 メモリ char c=“a”; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  3. 俺でもわかるポインタ講座 メモリ char c; int i=256; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  4. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  5. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  6. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]=“abc”; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  7. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]=“abc”; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  8. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]={1,2}; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  9. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]={1,2}; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  10. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  11. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; pt struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  12. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; pt.x =1; pt.y=2; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  13. 俺でもわかるポインタ講座 メモリ char c=“a”; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; ポインター用メモリ確保 (多くは32ビット) struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  14. 俺でもわかるポインタ講座 メモリ char c=“a”; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; cpr = &c; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  15. 俺でもわかるポインタ講座 メモリ char c=“a”; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; cpr = &c; *cpr=“b”; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  16. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; ポインター用メモリ確保 (多くは32ビット) struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  17. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]=“abc”; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; ポインター用メモリ確保 (多くは32ビット) struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  18. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]=“abc”; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; cpr = str; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  19. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]=“abc”; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; cpr = &str[1]; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  20. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]=“abc”; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; +1された struct point{ int x; int y: }; struct point pt; char **cppr; cpr = &str[1]; (*cpr)++; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  21. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]=“abc”; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; 1ずれた +1された struct point{ int x; int y: }; struct point pt; char **cppr; cpr = &str[1]; cpr++; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  22. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]={1,2}; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; ポインター用メモリ確保 (多くは32ビット) struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  23. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]={1,2}; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; ipr = &tab[0]; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  24. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]={1,2}; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; ipr = &tab[1]; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point)) 注意:+4されてる

  25. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]={1,2}; char *cpr; int *ipr; float *fpr; double *dpr; +1された struct point{ int x; int y: }; struct point pt; char **cppr; ipr = &tab[0]; (*ipr)++; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  26. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]={1,2}; char *cpr; int *ipr; float *fpr; double *dpr; +4された struct point{ int x; int y: }; struct point pt; char **cppr; ipr = &tab[0]; ipr++; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  27. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; 以下同様 struct point{ int x; int y: }; struct point pt; char **c; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  28. 俺でもわかるポインタ講座 メモリ char c[2]=“a”; char cc[2]=“b”; int i; float f; double d; int tab[2]; char *cpr[2]; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  29. 俺でもわかるポインタ講座 メモリ char c[2]=“a”; char cc[2]=“b”; int i; float f; double d; int tab[2]; char *cpr[2]; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; cpr[0]=c; cpr[1]=cc; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  30. 俺でもわかるポインタ講座 メモリ char c[2]=“a”; char cc[2]=“b”; int i; float f; double d; int tab[2]; char *cpr[2]; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; cppr = cpr struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  31. 俺でもわかるポインタ講座 メモリ char c[2]=“a”; char cc[2]=“b”; int i; float f; double d; int tab[2]; char *cpr[2]; int *ipr; float *fpr; double *dpr; +1された struct point{ int x; int y: }; struct point pt; char **cppr; **cppr++ [(*(*cppr))++] struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  32. 俺でもわかるポインタ講座 メモリ char c[2]=“a”; char cc[2]=“b”; int i; float f; double d; int tab[2]; char *cpr[2]; int *ipr; float *fpr; double *dpr; +1された struct point{ int x; int y: }; struct point pt; char **cppr; *cppr++ [ (*cppr)++] struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  33. 俺でもわかるポインタ講座 メモリ char c[2]=“a”; char cc[2]=“b”; int i; float f; double d; int tab[2]; char *cpr[2]; int *ipr; float *fpr; double *dpr; +2された struct point{ int x; int y: }; struct point pt; char **cppr; cppr++ struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  34. 俺でもわかるポインタ講座 メモリ char c[2]=“a”; char cc[2]=“b”; int i; float f; double d; int tab[2]; char *cpr[2]; int *ipr; float *fpr; double *dpr; +1された struct point{ int x; int y: }; struct point pt; char **cppr; **cppr++ [(*(*cppr))++] struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  35. 俺でもわかるポインタ講座 メモリ char c[2]=“a”; char cc[2]=“b”; int i; float f; double d; int tab[2]; char *cpr[2]; int *ipr; float *fpr; double *dpr; +1された struct point{ int x; int y: }; struct point pt; char **cppr; *(*cppr++)++ struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  36. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; ポインター用メモリ確保 (実際は32ビット) struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  37. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; 確保したメモリの先頭番地が代入 struct point{ int x; int y: }; struct point pt; char **cppr; 構造体用メモリ確保 struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  38. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; (*ptpr).x=1; (*ptpr).y=2; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

  39. 俺でもわかるポインタ講座 メモリ char c; int i; float f; double d; char str[5]; int tab[2]; char *cpr; int *ipr; float *fpr; double *dpr; struct point{ int x; int y: }; struct point pt; char **cppr; ptpr->x=1; ptpr->y=2; struct point *ptpr ptpr = (struct point*)malloc(sizeof (struct point))

More Related