回到线路起点? [英] Return to Start of Line?

查看:71
本文介绍了回到线路起点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望printf,下一个printf,返回到行的开头,只需打印
。换句话说,我想一次又一次地在

屏幕的同一部分上打印。 01,02,03,...是否有一些/ X这样做?

-

Wayne T. Watson(Watson Adventures,Prop。,Nevada City, CA)

(121.015度W,39.262度N)GMT-8小时标准。时间)

Obz网站:39?°15''7" N,121?°2''32" W,2700英尺


大多数车辆/鹿事故发生在日落时。

车辆鹿哨声无效。


网页:< home.earthlink.net/~mtnviews>

I''d like printf, the next printf, to return to the start of the line just
printed. In other words, I want to keep print over the same portion of the
screen again and again. 01, 02, 03, ... Is there some /X that does that?
--
Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39?° 15'' 7" N, 121?° 2'' 32" W, 2700 feet

Most vehicle/deer accidents occur at sunset.
Vehicle deer whistles are ineffective.

Web Page: <home.earthlink.net/~mtnviews>

推荐答案

W。 Wat son写道:
W. Wat son wrote:
我希望printf,下一个printf,返回刚开始打印的行的开头。换句话说,我想一次又一次地在屏幕的同一部分上打印。 01,02,03,...是否有/ X这样做?
I''d like printf, the next printf, to return to the start of the line
just printed. In other words, I want to keep print over the same portion
of the screen again and again. 01, 02, 03, ... Is there some /X that
does that?




printf(如何不被看见);

printf(\rMove上,没有什么可看的);


也可能对你有用:''\ b' '

干杯

Michael

-

电子邮件:我的是/ at / gmx / dot / de address。



printf("How not to be seen");
printf("\rMove on, there is nothing to be seen");

Also potentially useful for you: ''\b''
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.


" W。笏儿子 < WO ********* @ invalid.inv>写道:
"W. Wat son" <wo*********@invalid.inv> writes:
我希望printf(下一个printf)返回刚开始打印的行的开头。换句话说,我想一次又一次地在屏幕的相同部分上打印。 01,02,03,...是否有一些
/ X这样做?
I''d like printf, the next printf, to return to the start of the line
just printed. In other words, I want to keep print over the same
portion of the screen again and again. 01, 02, 03, ... Is there some
/X that does that?




''\ r''可能符合要求。

-

我希望有一天能学会阅读。

这似乎比写作更难。

- 理查德希思菲尔德



''\r'' may fit the bill.
--
"I hope, some day, to learn to read.
It seems to be even harder than writing."
--Richard Heathfield


W。 Wat son写道:
W. Wat son wrote:
我希望printf,下一个printf,返回刚刚打印的行的开头。换句话说,我想一次又一次地在屏幕的同一部分上打印。 01,02,03,...是否有/ X这样做?
cat main.c
#include< stdio.h>


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

for(size_t j = 0; j <4; ++ j)

fprintf(stdout,Hello world!\ rr);

fprintf(stdout,Hello world!\ n);

返回0;

}

gcc -Wall -std = c99 -pedantic -o main main.c
./main
I''d like printf, the next printf, to return to the start of the line
just printed. In other words, I want to keep print over the same portion
of the screen again and again. 01, 02, 03, ... Is there some /X that
does that? cat main.c #include <stdio.h>

int main(int argc, char* argv[]) {
for (size_t j = 0; j < 4; ++j)
fprintf(stdout, "Hello world!\r");
fprintf(stdout, "Hello world!\n");
return 0;
}
gcc -Wall -std=c99 -pedantic -o main main.c
./main



Hello world!


Hello world!


这篇关于回到线路起点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆