制作一个非常简单的菜单 [英] making a VERY simple menu

查看:66
本文介绍了制作一个非常简单的菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚上好,


我正在考虑为我正在制作的

a项目制作一个非常简单的基于DOS的(控制台)菜单,但是我不知道从哪里开始

这样的事情。有没有人有任何资源可以指示我

或者说明你完全做了什么。就像我说的那样,我不想要一个真正复杂的菜单,只需一个标题和大约三个

选项。一旦我知道我在做什么,我会添加更多东西。


提前感谢


Tim

Good evening,

I was thinking about making a very simple DOS based (console) menu for
a project that i am working on, but I have no idea where to start for
something like this. Does anyone have any resources they could point me
to or shed some light on what it is that you do exactly. Like I said, I
don''t want a real complicated menu, just a title and about three
options. I will add more stuff once I know what it is that I am doing.

thanks in advance

Tim

推荐答案

tr ***** @ gmail.com 写道:
我正在考虑为我正在研究的项目制作一个非常简单的基于DOS(控制台)的菜单,但我不知道从哪里开始为选项。一旦我知道我正在做什么,我会添加更多东西。
I was thinking about making a very simple DOS based (console) menu for
a project that i am working on, but I have no idea where to start for
something like this. Does anyone have any resources they could point me
to or shed some light on what it is that you do exactly. Like I said, I
don''t want a real complicated menu, just a title and about three
options. I will add more stuff once I know what it is that I am doing.




使用printf()打印选项。使用scanf()输入用户的选择。不要
忘记检查输入部分的错误。重复,直到你有一个

有效选择。


试试吧,它真的很简单。


Uli



Print options using printf(). Input the user''s choice using scanf(). Don''t
forget to check for errors in the input part. Repeat until you have a
valid choice.

Just try it, it''s really simple.

Uli


tr*****@gmail.com 写道:
晚上好,

我正在考虑为我正在工作的项目制作一个非常简单的基于DOS的(控制台)菜单在,但我不知道从哪里开始
这样的事情。有没有人有任何资源,他们可以指出我或者说明你完全做了什么。就像我说的那样,我不想要一个真正复杂的菜单,只是一个标题和三个
选项。一旦我知道我在做什么,我会添加更多东西。
Good evening,

I was thinking about making a very simple DOS based (console) menu for
a project that i am working on, but I have no idea where to start for
something like this. Does anyone have any resources they could point me
to or shed some light on what it is that you do exactly. Like I said, I
don''t want a real complicated menu, just a title and about three
options. I will add more stuff once I know what it is that I am doing.




取决于。如果你想使用箭头键等花哨的东西,

那么你错了,因为我们只讨论标准C.

讨论DOS的新闻组可能会指出

你正朝着正确的方向前进。

如果你坚持使用标准C,你可以做一些事情

线条

做{

/ *输出选项* /

fflush(stdout);

/ *读回复,不要使用* scanf ()见clc faq * /

/ * variant a)安全用户选择* /

} while(!validchoice);

/ * a)根据选择发送* /



做{

/ *输出选项* /

fflush (stdout);

/ *在回复中读取,不要使用* scanf()参见clc faq * /

/ * variant b)根据非退出发送选择* /

} while(!exitmenu);


干杯

Michael

-

电子邮箱:我的是/ at / gmx / dot / de地址。



Depends. If you want fancy stuff using arrow keys etc.,
then you are wrong here as we discuss only standard C.
A newsgroup discussing DOS will probably be able to point
you in the right direction.
If you stick with standard C, you can do something along
the lines
do {
/* Output options */
fflush(stdout);
/* Read in the reply, do not use *scanf() see clc faq */
/* variant a) safe user choice */
} while (!validchoice);
/* a) dispatch according to choice*/
or
do {
/* Output options */
fflush(stdout);
/* Read in the reply, do not use *scanf() see clc faq */
/* variant b) dispatch according to non-exit choice */
} while (!exitmenu);

Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.


Ulrich Eck hardt写道:
Ulrich Eckhardt wrote:
tr*****@gmail.com 写道:
我正在考虑为我正在进行的项目制作一个非常简单的基于DOS的(控制台)菜单,但我不知道从哪里开始
这个。有没有人有他们能够指出的任何资源,或者说明你究竟做了什么。
就像我说的,我不想要一个真正复杂的菜单,只是一个标题和
大约有三个选项。一旦我知道我正在做什么,我会添加更多东西。
使用printf()打印选项。使用scanf()输入用户的选择。
不要忘记检查输入部分中的错误。重复,直到你有一个有效的选择。
I was thinking about making a very simple DOS based (console) menu
for a project that i am working on, but I have no idea where to start
for something like this. Does anyone have any resources they could
point me to or shed some light on what it is that you do exactly.
Like I said, I don''t want a real complicated menu, just a title and
about three options. I will add more stuff once I know what it is
that I am doing.
Print options using printf(). Input the user''s choice using scanf().
Don''t forget to check for errors in the input part. Repeat until you
have a valid choice.




我建议使用printf()/ fgets()/ sscanf()代替在

安全方面(NOT gets()),和/ do /检查无效输入。

试试看,它真的很简单。



I''d suggest to use printf()/fgets()/sscanf() instead, just to be on the
safe side (NOT gets()), and /do/ check for invalid input.
Just try it, it''s really simple.




我同意。


干杯


弗拉基米尔

-

你知道,当它需要全部动力才能出租时,你已经装好了装备。



I concur.

Cheers

Vladimir

--
You know you''ve landed gear-up when it takes full power to taxi.


这篇关于制作一个非常简单的菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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