换页 (\f) 和垂直制表符 (\v) 在 C 中不起作用 [英] Formfeed (\f) and vertical tab (\v) not working in C

查看:24
本文介绍了换页 (\f) 和垂直制表符 (\v) 在 C 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很长一段时间后,我正在编写一个 C 程序.在编写程序时,我不得不使用换页和垂直制表符.所以我在程序中使用了 \f 和 \v.

After a long time I am writing a C program. While writing the program I had to use formfeed and vertical tab. so I used \f and \v in program.

但是在运行代码而不是 Formfeed 和垂直选项卡时,我可以看到男性和女性的符号.我不知道为什么它不起作用.

But while running the code instead of Formfeed and vertical tab I can see symbols of male and female. I don't know why it is not working.

以下是我的代码示例:

#include<stdio.h>
#include<conio.h>

void main()
{
    printf("I am \f SpiderCode\n");
    printf("I am \v SpiderCode\n");
    getch();
}

[注意:以上代码我使用的是visual studio 2013]

[Note: I am using visual studio 2013 for above code]

以上代码的输出

推荐答案

这与您的代码无关,这是程序输出的显示驱动程序的问题.控制台无法识别 '\f' 和 '\v' 代码,因此它只显示相应的字符.'\f' 映射到值为 12 的字符,而 '\v' 映射到 11.

This has nothing to do with your code, this is an issue with the display driver for the output of the program. The console does not recognise the '\f' and '\v' codes, so it just displays the corresponding characters instead. The '\f' maps to a character with a value 12 and '\v' to 11.

在过去,您会运行 ANSI.SYS 之类的东西,它会识别特殊代码并更新控制台,例如更改颜色、移动光标等.

In the old days, you'd have something like ANSI.SYS running which would identify special codes and update the console, such as changing the colour, moving the cursor, etc.

这篇关于换页 (\f) 和垂直制表符 (\v) 在 C 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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