C中的textcolor()和textbackground()

时间:2016-09-27 14:24:42

标签: c dos turbo-c text-coloring retro-computing

我正在使用C项目(我认为我使用的编译器是Turbo C++ 3.0)。我使用了一些Sub FirstGood() Dim v As Double, FoundIt As Boolean bad = Array(1.2753, 1.6677, 2.0601, 2.5506, 2.943, 3.4335) For i = 1 To 9999 v = Cells(i, "A").Value FoundIt = True For j = 0 To 5 If bad(j) = v Then FoundIt = False Next j If FoundIt Then MsgBox "Found valid data on row # " & i Exit For End If Next i End Sub textcolor()函数来为一些文本着色。当我第一次运行时,控制台在黑色背景上显示正常的颜色 - 白色文本。

The colors of the console is in their normal/default state when I run it the first time.

但是,当我第二次运行代码依此类推时,背景颜色变为蓝色。

When I run the code for the second time and so on, the background color becomes blue.

我在上面的程序中使用了以下代码(使用textbackground()的唯一格式化文本是洋红色和蓝色背景中的文本):

cprintf()

我怀疑这是因为我使用的编译器,但我仍然不确定。有什么方法可以解决这个问题吗?

1 个答案:

答案 0 :(得分:3)

完成绘制想要拥有MAGENTA背景的字母后,您应该将背景颜色重置为黑色:

MainActivity.java