| |

VerySource

 Forgot password?
 Register
Search
View: 884|Reply: 6

Problems setting background color

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-17 06:40:01
| Show all posts |Read mode
#include <conio.h>

int main (void)
{

   window (10,10,40,11);
   textcolor (RED);
   textbackground (WHITE);
   cprintf ("This is a test\r\n");

   return 0;
}
// I cannot compile such code with vc6. But I can compile it with turboc2
// Which header file should I add when compiling in windows mode?
//Thank you
Reply

Use magic Report

0

Threads

36

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-1-22 11:27:01
| Show all posts
These functions are not available in C ++ 's <conio.h>
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-2-4 13:30:01
| Show all posts
What should I do?
Come and support heroes!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-8 11:45:02
| Show all posts
Console programs like this are best compiled and linked under TC!
Because under VC, because some new programming systems and old ones are involved, there will be some unexpected problems!
For example, int type is 2 bytes under TC and 4 bytes under VC!
Reply

Use magic Report

0

Threads

19

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-2-8 14:30:01
| Show all posts
tc is based on the dos environment and vc is based on the windows environment. The two operating systems handle the display differently. DOS operates through interrupts and write buffers directly. Windows has its own message mechanism. The functions you use are not functions of c, they are extensions of tc. Of course, there are no such functions in vc, and since windows is different from dos, there is no similar function in vc.
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-2-13 03:15:01
| Show all posts
LZ positive solution.
Is such that. I have also been depressed about this problem when I first used VC ++. Textcolor () and biosksy () are not available in VC. Of course, there are many other TC extension functions that are not available.
Also, asgogoandsososaid, TC is based on the DOS environment and VC is based on the Windows environment, which makes them very different. For example, the header files such as dos.h and bios.h in TC are not available in VC. Just pay attention while studying.
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 United States

Post time: 2020-2-13 09:30:02
| Show all posts
gosh. I made a typo just now. "LZ positive solution" should be "LS positive solution".
Hereby corrected.
Sweat ~~~
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list