파일시스템의 버디 기법에 사용된 배열 어래이 관련 내용
Created
June 16, 2015 10:45
-
-
Save kimhoki/d755555ac8d06d3054aa to your computer and use it in GitHub Desktop.
[ array] 파일시스템의 버디 기법에 사용된 배열
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
int a[7] = {1,2,3,4,5,6,7}; | |
int *p; | |
int index; | |
p = &a[5]; | |
index = p -a; | |
printf("index: %d\n", index); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
int a[7] = {1,2,3,4,5,6,7}; | |
int *p; | |
int index; | |
p = &a[5]; | |
//(120 - 100) / sizeof(a[0]); | |
index = p -a; // &a[5] - &a[0] | |
// &*(a+5) - &*(a+0) | |
// a+5 -a | |
// 5 | |
printf("index: %d\n", index); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment