잡다
-
GNU Compiler __attribute__잡다 2014. 6. 19. 09:17
__attribute__((__used__))컴파일러가 코드를 최적화 할 때, 사용되지 않은 변수라 하더라도 제거하지 않도록 한다"unused variable" 관련 compile warning을 방지__attribute__((__aligned__(x)))변수가 위치하는 메모리의 주소를 x의 배수로 정렬한다e.g) __attribute__((__aligned__(sizeof(long))))__attribute__((__packed__))구조체 변수에대한 메모리를 할당 할 때, 기본적인 align 규칙(보통은 word, 4 bytes)을 따르지 않고, 실제 데이터의 크기 만큼만 메모리를 할당 하도록 한다__attribute__((__section__(x)))변수가 ELF 오브젝트 내부에 x라는 이름을 갖는..
-
과제 : 문자열치환잡다 2014. 4. 8. 14:09
처음 한 소스 #include #include char * Change_word(char * string, char * old_word, char *new_word); int main() { char caOld_word[32]; char caNew_word[32]; char caString_word[50]; fputs("Input String : ", stdout); fgets(caString_word, 31, stdin); fflush(stdin); fputs("Choose String to modify : ", stdout); fgets(caOld_word, 11, stdin); fflush(stdin); fputs("Input String to modify : ", stdout); fgets(caN..