C语言实现滚动字幕

2022-12-10 09:08:52   第一文档网     [ 字体: ] [ 阅读: ] [ 文档下载 ]
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。下载word有问题请添加QQ:admin处理,感谢您的支持与谅解。点击这里给我发消息

#第一文档网# 导语】以下是®第一文档网的小编为您整理的《C语言实现滚动字幕》,欢迎阅读!
字幕,滚动,语言,实现

.

C语言实现滚动字幕

#include

#include #include #include #include

#define TIME_INTERVAL (CLOCKS_PER_SEC / 50)

int main(int argc, char* argv[]) ...{

int i, j; long c;

char str[80] = "Hello world!"; int l = strlen(str); char sleft[80]; char sright[80]; int scrwidth = 79;

while (1) ...{

for (i = 0; i <= scrwidth; i++) ...{

if (i <= scrwidth - l) ...{

c = clock();

for (j = 0; j < i; j++) ...{

printf(" "); }

printf("%s ", str);

while (clock() - c <= TIME_INTERVAL) ; } else ...{

c = clock(); strcpy(sleft, str);

strcpy(sright, str + l - (i - (scrwidth - l))); *(sleft + l - (i - (scrwidth - l))) = NULL; for (j = 0; j < i; j++) ...{

1 / 2'.


.

printf(" "); }

printf("%s ", sleft); printf("%s ", sright);

while (clock() - c <= TIME_INTERVAL) ; } } }

return 0; }

2 / 2'.


本文来源:https://www.dywdw.cn/a4e6e540ac1ffc4ffe4733687e21af45b207fe5b.html

相关推荐
推荐阅读