티스토리

잉여롭다
검색하기

블로그 홈

잉여롭다

hoong2.tistory.com/m

잉여로운 사람의 잉여로운 실험을 하는 잉여로운 블로그

구독자
5
방명록 방문하기
공지 대학생 정보보안 연합 동아리-SUA(⋯ 모두보기

주요 글 목록

  • linux getch 함수 리눅스에는 getch 함수가 없어 여기저기 찾아보다가 발견하게 된 소스 #include int getch(void) { int ch; struct termios buf; struct termios save; tcgetattr(0, &save); buf = save; buf.c_lflag &= ~(ICANON|ECHO); buf.c_cc[VMIN]=1; buf.c_cc[VTIME]=0; tcsetattr(0,TCSAFLUSH, &buf); ch = getchar(); tcsetattr(0,TCSAFLUSH, &save); return ch; } 위 코드를 getch.h로 만든 후 작성하려는 코드에 #include #include "getch.h" 인클루드 시켜주면 getch 함수를 사용할 수 있음 공감수 0 댓글수 0 2019. 8. 6.
  • 포인터 계산기 #include #include #include #include #define SIZE_4K 4096 int main(int argc, char *argv[]) { int trim; double num1, num2, result; char str[SIZE_4K] = {0,}; char oper; char *data, *data_tmp; printf("계산할 값을 입력해주세요.(예: 1+3, 2*5 ... 종료: exit)\n"); do { trim = 0; num1 = 0; num2 = 0; result = 0; oper = '\0'; data = NULL; data_tmp = NULL; printf("수식: "); fgets(str, sizeof(str), stdin); data_tmp = (char*.. 공감수 0 댓글수 0 2018. 4. 11.
  • linux libpcap.h documentation #define HAVE_REMOTE#include main(){ pcap_if_t *alldevs; pcap_if_t *d; int i=0; char errbuf[PCAP_ERRBUF_SIZE]; /* Retrieve the device list from the local machine */ if (pcap_findalldevs(&alldevs, errbuf) == -1) { fprintf(stderr,"Error in pcap_findalldevs(&alldevs, errbuf: %s\n", errbuf); exit(1); } /* Print the list */ for(d= alldevs; d != NULL; d= d->next) { printf("%d. %s", ++i, d->name); if (d.. 공감수 0 댓글수 0 2018. 4. 11.
  • 기본형 #include int main(void){ printf("Hello World!\n"); return 0; } 공감수 0 댓글수 0 2018. 3. 18.
    문의안내
    • 티스토리
    • 로그인
    • 고객센터

    티스토리는 카카오에서 사랑을 담아 만듭니다.

    © Kakao Corp.