Which C++ function changes text or background color (MS Visual studio)? For example cout<<"This text"; how to make “This text” red color.
Which C++ function changes text or background color (MS Visual studio)? For example cout<<This
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Colour isn’t a C++ thing, but a property of your terminal. If your terminal speaks ANSI (e.g. any Linux terminal, or DOS or Windows NT if you add
DEVICE=C:\DOS\ansi.systo yourconfig.sys, or later Windows if you call the shell withcmd.exe /kansicon), then you can try the following gimmick:Wikipedia has a list of ANSI escape sequences.