"Hello, World!"를 인쇄하는 프로그램이 있습니다. 천천히 스크롤되는 텍스트에서. usleep () 함수에 unistd.h 라이브러리를 사용하고 있으며 std :: cout을 사용하여 문자를 표준 출력으로 인쇄하고 있습니다.
#include <iostream>
#include <stdio.h>
#include <unistd.h>
char hello[13]={'H','e','l','l','o',',',' ','W','o','r','l','d'};
int main (){
for(int i=0; i<14; i++){
std::cout<<hello[i]; //it prints the entire string after
usleep(100000); //100000 ms, but it should print a char after
} //every 100 ms.
}
출력 스트림을 비워야 할 수도 있습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다