구조체포인터 질문
로와
global.h
..
struct direntry {
chardeName[8]; // filename, blank filled
#define SLOT_EMPTY 0x00// slot has never been used
#define SLOT_E5 0x05// the real value is 0xe5
#define SLOT_DELETED 0xe5// file in this slot deleted
unsigned chardeExtension[3]; // extension, blank filled
unsigned chardeAttributes; // file attributes
#define ATTR_NORMAL 0x00// normal file
#define ATTR_READONLY 0x01// file is readonly
#define ATTR_HIDDEN 0x02// file is hidden
#define ATTR_SYSTEM 0x04// file is a system file
#define ATTR_VOLUME 0x08// entry is a volume label
#define ATTR_LONG_FILENAME0x0f// this is a long filename entry
#define ATTR_DIRECTORY 0x10// entry is a directory name
#define ATTR_ARCHIVE 0x20// file is new or modified
unsigned chardeLowerCase; // NT VFAT lower case flags
#define LCASE_BASE 0x08// filename base in lower case
#define LCASE_EXT 0x10// filename extension in lower case
unsigned chardeCHundredth;// hundredth of seconds in CTime
unsigned chardeCTime[2];// create time
unsigned chardeCDate[2];// create date
unsigned chardeADate[2];// access date
unsigned int deHighClust;// high bytes of cluster number
unsigned chardeMTime[2];// last update time
unsigned chardeMDate[2];// last update date
unsigned int deStartCluster;// starting cluster of file
unsigned longdeFileSize;// size of file in bytes
};
..
main.c
..
..
unsigned char fatGetDirEntry(unsigned long cluster)
{
unsigned char count_file = 0; // 파일의 총 개수
unsigned long offset=0;
struct direntry *de = 0; // avoid compiler warning by initializing
int index;
unsigned int clus_hi, clus_lo;
unsigned long cluster_number;
for (offset=0; ; offset++)
{
de = (struct direntry *) fatDir(cluster, offset);
if (de == NULL)
return count_file;
for (index=0; index16; index++) // 16 direntries
{
if (*de-deName == SLOT_EMPTY) //slot_empty이거는 헥사파일임
return count_file; // there is no more direntries
if((*de-deName != SLOT_DELETED) && (de-deAttributes != ATTR_LONG_FILENAME))
{
clus_hi = de-deHighClust;
clus_lo = de-deStartCluster;
cluster_number = (unsigned long)(clus_hi);
cluster_number = 16;
cluster_number |= (unsigned long)(clus_lo);
fatFileStartClust[count_file++] = cluster_number;
}
de++;
}// end of sector
}// end of cluster
return count_file;
}
여기서 direntry라는 곳에서 *de-deName 라고 해서 == SLOT_EMPTY라고 비교하고 있고 밑에 줄에는 de-deAttributes 해서
같은지 다른지 비교하고 있는데 *de 랑 de 에서 이거 뭐가 다른가요... 구조체에서.... 뭐가 좀 이상하다 싶어 올려봅니다.
-
내꺼
일종의 뭐랄까 만든사람이 그렇게 쓰게 만들어 놓은 것이죠..ㅎㅎ
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2692343 | scnaf에 자꾸 선언을 참조하라는데;; (8) | 도래 | 2025-04-22 |
2692282 | 도스상에서 생성된 exe파일에 press~ 뜨게 하기 (4) | 회사원 | 2025-04-21 |
2692256 | scanf("%*c"); ㅠㅠ 고수님들 | 거북이 | 2025-04-21 |
2692230 | 하노이탑 질문입니다. (1) | 미쁘다 | 2025-04-21 |
2692210 | 정보 올림피아드 문제인데.. 풀이 과정이 궁금합니다.(재귀함수) (5) | 물티슈 | 2025-04-20 |
2692144 | C언어와 리눅스에 대한 질문입니다. | 싴흐한세여니 | 2025-04-20 |
2692114 | 컨텍스트 스위칭하는데 걸리는 시간 측정.. | YourWay | 2025-04-19 |
2692086 | 간접참조 연산자, 증감연산자 질문이용! (2) | 블랙캣 | 2025-04-19 |
2692056 | 주석좀 달아주세요. 몇개적엇는데 몇개만달아주세요. (2) | DevilsTears | 2025-04-19 |
2691978 | 진수 쉽게 이해하는법... (3) | 지지않는 | 2025-04-18 |
2691949 | getchar() 한 문자를 입력받는 함수 질문 | 채꽃 | 2025-04-18 |
2691919 | 배열 정렬 및 합치기 질문입니다. | 사과 | 2025-04-18 |
2691845 | c언어왕초보 질문이 있습니다........ | 루나 | 2025-04-17 |
2691815 | void add(int num); 함수... (4) | 살랑살랑 | 2025-04-17 |
2691756 | 명령 프롬프트 스크롤바가 없어요 | 두메꽃 | 2025-04-16 |
2691725 | 자료구조에 관련해서 질문이 있어 글을 올립니다. | 누리알찬 | 2025-04-16 |
2691697 | if 문에서 구조체 배열에 저장되있던 문자열 검사하는 법 ? (2) | 민트맛사탕 | 2025-04-16 |
2691678 | C언어 함수 질문이요~!!! | 연보라 | 2025-04-15 |
2691650 | 반복문 | 돋가이 | 2025-04-15 |
2691618 | 링크드리스트 개념 질문이예요 (3) | 맨마루 | 2025-04-15 |