Research/Programming28 fflush(stdin)? __fpurge(stdin)! 간단한 테스트 프로그램을 짜려고 getchar()를 사용하다가 뻘짓만.... ㅡ.ㅡ while(1) { print_usage(); choice = getchar(); switch(choice) { 어쩌고... choice2 = getchar(); 저쩌고... } } 위와 같이 만들면 두번째 입력에서 꼭 엔터키가 먹어버리는 현상이 발생한다. 그래서, getchar() 다음에 __fpurge(stdin) 실행하면 원하는 대로 결과를 얻을 수 있다. 아래 방법은 테스트 해보지 않았음. while (getchar() != '\n') continue; 2012. 2. 10. sqlite 파일, 테이블, 쿼리, 업데이트 sqlite로 DB를 구성할 때 다음과 같은 점을 고려 1. 레코드 업데이트 속도는 파일 사이즈에 영향을 덜(?) 받는 거 같다. 2. 레코드 쿼리 속도는 파일 사이즈에 영향을 많이 받는 거 같다. 당연한 건가? ㅡ.ㅡ 2011. 5. 18. pthread_cond_wait pthread_cond_wait()은 쓰레드가 휴면상태가 되도록 한다. 휴면상태는 pthread_cond_signal()이라는 함수를 통해 깨울 수 있다. pthread_cond_wait()은 두개의 인자가 들어가는데, 첫번째는 조건변수(conditional variable) 이고 두번째는 잠겨진 mutex이다. 조건변수는 pthread_cond_signal()의 인자로 사용되어 진다. pthread_cond_wait()가 호출되면 내부적으로 mutex를 잠금 해제하고 쓰레드 실행을 중지시킨다. pthread_cond_wat()의 이러한 내부 작동은 언제나 함께 발생(atomic)한다. 이들 사이에 실행되는 쓰레드는 없다. 또 다른 쓰레드가 pthread_cond_signal()을 호출하면 조건 변수를 .. 2011. 5. 11. Worker Thread in Qt using Signals & Slots origin URL : http://cdumez.blogspot.com/2011/03/worker-thread-in-qt-using-signals-slots.html Saturday, March 12, 2011 Worker Thread in Qt using Signals & Slots Qt provides platform-independent threading classes, a thread-safe way of posting events, and signal-slot connections across threads. Multithreaded programming allows taking advantage of multiprocessor machines and it is also useful to per.. 2011. 4. 12. An Introduction to SQLite An Introduction to SQLite 51:01 - 3년 전 Google TechTalks May 31, 2006 Richard Hipp ABSTRACT SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. SQLite implements a large subset of SQL-92 and stores a complete database in a single disk file. The library footprint is less than 250 KB making is suitable for use in embedded devices and app.. 2010. 2. 1. Qt, undefined reference to `vtable for g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.6.0/lib -o mythstb version.o main.o globalsettings.o action.o actionset.o mythcontrols.o keybindings.o keygrabber.o livemgrwnd.o chansearch.o channellist.o banner.o setup-language.o setup-avoutput.o svcmgrthread.o moc_mythcontrols.o moc_keygrabber.o moc_livemgrwnd.o moc_chansearch.o moc_channellist.o moc_banner.o moc_setup-language.o moc_setup-avoutput.o .. 2010. 1. 26. 이전 1 2 3 4 5 다음