为我的节目制作边框 [英] Making a border for my program

查看:60
本文介绍了为我的节目制作边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,我现在正试图为我的程序制作一个边框,我一直在研究如何这样做,我还没有尝试编码1,但只是一个简单的问题。

我定义高度和宽度吗?这对gotoXY也有帮助吗?

现在就像星号一样做一个简单的边框。



我是什么尝试过:



非常感谢您的帮助。

Hey guys, I am now trying to make a border for my program and i've been doing my research on how to do so, I haven't tried coding 1 as of yet but just a quick question.
Do i define Height and Width? Would that also help me with the gotoXY?
Just trying to do a simple border for now like asterisks.

What I have tried:

Thank you very much for the help.

推荐答案

我们可以基于这些小信息真的很有帮助。

标准C没有任何真正有用的输出指令,只需 printf - 所以你可以不要编写通用代码将光标移动到特定点,或者在光标所在的任何位置写入字符。这使得在控制台类型应用程序中添加边框(来自星号是你正在尝试做的事情)真的相当困难,如果不是完全不切实际的话(因为每次任何改变都需要重新绘制整个屏幕,甚至一个字符)。



您使用的特定编译器/操作系统可能包含库函数来执行此操作,但我们不知道您使用的是哪个系统正在使用,所以我们无法评论!

所以首先找出你的编译器提供的显示操作函数的方式,并查看它们的使用示例。
We can't really help, based on that little information.
Standard C doesn't have any really useful output instructions, just printf - so you can't write generic code to move the cursor to a specific point, or write a character at any point other than where the cursor is. Which makes adding a border in a console type application (which from the "asterisks" is what you are trying to do) really rather difficult, if not totally impractical (in that you would have to repaint the entire screen each time anything changed, even a single character).

It may be that the specific compiler /operating system you are using may include library functions to do that, but we have no idea what system you are using, so we can't comment!
So start by finding out what your compiler provides in the way of display manipulation functions, and look for examples of them in use.


这篇关于为我的节目制作边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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