如何将彩色文本输出到 Linux 终端?

2024-10-09 09:10:00
admin
原创
83
摘要:问题描述:如何将彩色字符打印到支持它的 Linux 终端?如何知道终端是否支持颜色代码?解决方案 1:您需要输出ANSI 颜色代码。请注意,并非所有终端都支持此功能;如果不支持颜色序列,则会出现乱码。例子: cout << "bold red tex...

问题描述:

如何将彩色字符打印到支持它的 Linux 终端?

如何知道终端是否支持颜色代码?


解决方案 1:

您需要输出ANSI 颜色代码。请注意,并非所有终端都支持此功能;如果不支持颜色序列,则会出现乱码。

例子:

 cout << "bold red text
";

这里,是 ESC 字符,ASCII 27。后面跟着[,然后是零个或多个用 分隔的数字;,最后是字母m。数字描述了从该点开始要切换到的颜色和格式。

前景色和背景色的代码是:

         foreground background
black        30         40
red          31         41
green        32         42
yellow       33         43
blue         34         44
magenta      35         45
cyan         36         46
white        37         47

此外,您还可以使用以下选项:

reset             0  (everything back to normal)
bold/bright       1  (often a brighter shade of the same colour)
underline         4
inverse           7  (swap foreground and background colours)
bold/bright off  21
underline off    24
inverse off      27

请参阅维基百科上的表格,了解其他不太广泛支持的代码。


要确定您的终端是否支持颜色序列,请读取环境变量的值TERM。它应该指定使用的特定终端类型(例如,,,,vt100... ) 。然后在terminfo 数据库中查找;检查功能。gnome-terminal`xtermscreencolors`

解决方案 2:

基础知识

我编写了一个 C++ 类,可用于设置输出的前景色和背景色。此示例程序是打印This ->word<- is red.和格式化它的示例,以便前景色为word红色。

#include "colormod.h" // namespace Color
#include <iostream>
using namespace std;
int main() {
    Color::Modifier red(Color::FG_RED);
    Color::Modifier def(Color::FG_DEFAULT);
    cout << "This ->" << red << "word" << def << "<- is red." << endl;
}

来源

#include <ostream>
namespace Color {
    enum Code {
        FG_RED      = 31,
        FG_GREEN    = 32,
        FG_BLUE     = 34,
        FG_DEFAULT  = 39,
        BG_RED      = 41,
        BG_GREEN    = 42,
        BG_BLUE     = 44,
        BG_DEFAULT  = 49
    };
    class Modifier {
        Code code;
    public:
        Modifier(Code pCode) : code(pCode) {}
        friend std::ostream&
        operator<<(std::ostream& os, const Modifier& mod) {
            return os << "[" << mod.code << "m";
        }
    };
}

先进的

您可能想要为该类添加其他功能。例如,可以添加洋红色,甚至粗体等样式。为此,只需在枚举中添加另一个条目即可Code。这是一个很好的参考。

解决方案 3:

在输出任何所需的颜色之前,请确保您处于终端中:

[ -t 1 ] && echo 'Yes I am in a terminal'  # isatty(3) call in C

然后你需要检查终端功能是否支持彩色

在基于 Linux 的系统上,您可以获得以下支持的颜色数量terminfo

Number_Of_colors_Supported=$(tput colors)

termcap 在基于 BSD的系统上,您可以获得以下支持的颜色数量

Number_Of_colors_Supported=$(tput Co)

然后做出决定:

[ ${Number_Of_colors_Supported} -ge 8 ] && {
    echo 'You are fine and can print colors'
} || {
    echo 'Terminal does not support color'
}

顺便说一句,不要像之前对 ESC 字符建议的那样使用颜色。使用标准调用终端功能,它将为您分配特定终端支持的正确颜色。

基于 BSD

fg_black="$(tput AF 0)"
fg_red="$(tput AF 1)"
fg_green="$(tput AF 2)"
fg_yellow="$(tput AF 3)"
fg_blue="$(tput AF 4)"
fg_magenta="$(tput AF 5)"
fg_cyan="$(tput AF 6)"
fg_white="$(tput AF 7)"
reset="$(tput me)"

基于Linux

fg_black="$(tput setaf 0)"
fg_red="$(tput setaf 1)"
fg_green="$(tput setaf 2)"
fg_yellow="$(tput setaf 3)"
fg_blue="$(tput setaf 4)"
fg_magenta="$(tput setaf 5)"
fg_cyan="$(tput setaf 6)"
fg_white="$(tput setaf 7)"
reset="$(tput sgr0)"

用作

echo -e "${fg_red}  Red  ${fg_green} Bull ${reset}"

解决方案 4:

正如其他人所说,您可以使用转义符。您可以使用我的标题以使其更容易:

#ifndef _COLORS_
#define _COLORS_

/* FOREGROUND */
#define RST  ""
#define KRED  ""
#define KGRN  ""
#define KYEL  ""
#define KBLU  ""
#define KMAG  ""
#define KCYN  ""
#define KWHT  ""

#define FRED(x) KRED x RST
#define FGRN(x) KGRN x RST
#define FYEL(x) KYEL x RST
#define FBLU(x) KBLU x RST
#define FMAG(x) KMAG x RST
#define FCYN(x) KCYN x RST
#define FWHT(x) KWHT x RST

#define BOLD(x) "" x RST
#define UNDL(x) "" x RST

#endif  /* _COLORS_ */

使用标题宏的示例如下:

#include <iostream>
#include "colors.h"
using namespace std;

int main()
{
    cout << FBLU("I'm blue.") << endl;
    cout << BOLD(FBLU("I'm blue-bold.")) << endl;
    return 0;
}

在此处输入图片描述

解决方案 5:

据我了解,典型的 ANSI 颜色代码

"[{FORMAT_ATTRIBUTE};{FORGROUND_COLOR};{BACKGROUND_COLOR}m{TEXT}[{RESET_FORMATE_ATTRIBUTE}m"

由(名称和编解码器)组成

  • 格式属性

 { "Default", "0" },
 { "Bold", "1" },
 { "Dim", "2" },
 { "Italics", "3"},
 { "Underlined", "4" },
 { "Blink", "5" },
 { "Reverse", "7" },
 { "Hidden", "8" }
  • 底色

 { "Default", "39" },
 { "Black", "30" },
 { "Red", "31" },
 { "Green", "32" },
 { "Yellow", "33" },
 { "Blue", "34" },
 { "Magenta", "35" },
 { "Cyan", "36" },
 { "Light Gray", "37" },
 { "Dark Gray", "90" },
 { "Light Red", "91" },
 { "Light Green", "92" },
 { "Light Yellow", "93" },
 { "Light Blue", "94" },
 { "Light Magenta", "95" },
 { "Light Cyan", "96" },
 { "White", "97" }
  • 背景颜色

 { "Default", "49" },
 { "Black", "40" },
 { "Red", "41" },
 { "Green", "42" },
 { "Yellow", "43" },
 { "Blue", "44" },
 { "Megenta", "45" },
 { "Cyan", "46" },
 { "Light Gray", "47" },
 { "Dark Gray", "100" },
 { "Light Red", "101" },
 { "Light Green", "102" },
 { "Light Yellow", "103" },
 { "Light Blue", "104" },
 { "Light Magenta", "105" },
 { "Light Cyan", "106" },
 { "White", "107" }
  • 文本

  • 重置格式属性

 { "All", "0" },
 { "Bold", "21" },
 { "Dim", "22" },
 { "Underlined", "24" },
 { "Blink", "25" },
 { "Reverse", "27" },
 { "Hidden", "28" }

有了这些信息,就很容易为字符串“I am a banana!”着色了,底色为“黄色”,背景色为“绿色”,如下所示

"I am a Banana!"

或者使用 C++ 库colorize

auto const& colorized_text = color::rize( "I am a banana!", "Yellow", "Green" );
std::cout << colorized_text << std::endl;

此处有更多带有 FORMAT ATTRIBUTE 的示例在此处输入图片描述

解决方案 6:

我使用以下解决方案,它非常简单和优雅,可以轻松粘贴到源代码中,并且适用于 Linux/C++:

const std::string red("");
const std::string green("");
const std::string yellow("");
const std::string cyan("");
const std::string magenta("");
const std::string reset("");

std::cout << "Measured runtime: " << yellow << timer.count() << reset << std::endl;

解决方案 7:

这是一个老话题,但我编写了一个具有嵌套子类和静态成员的类,用于由简单的 C 宏定义的颜色。

我从用户 no2pencil 在 dreamincode.net 上color发表的这篇关于C 语言编程中的彩色文本的文章中获得了该功能。

我这样做是为了能够像这样使用 std::cout 流中的静态常量:

cout << zkr::cc::fore::red << "This is red text. " 
     << zkr::cc::console << "And changing to console default colors, fg, bg."
     << endl;

该课程和测试程序源代码可在此处下载。

cc::console将重置为控制台默认颜色和属性,cc::underline将为文本添加下划线,该功能在我已经测试过的测试程序的 putty 上有效。

颜色:

black
blue
red
magenta
green
cyan
yellow
white

lightblack
lightblue
lightred
lightmagenta
lightgreen
lightcyan
lightyellow
lightwhite

fore它可以与静态类和back静态子类一起使用cc

编辑2017

我只是在这里添加类代码以使其更加实用。

颜色代码宏:

#define CC_CONSOLE_COLOR_DEFAULT ""
#define CC_FORECOLOR(C) "[" #C "m"
#define CC_BACKCOLOR(C) "[" #C "m"
#define CC_ATTR(A) "[" #A "m"

以及定义屏幕颜色或属性的主颜色函数:

char *cc::color(int attr, int fg, int bg)
{
    static char command[13];

    /* Command is the control command to the terminal */
    sprintf(command, "%c[%d;%d;%dm", 0x1B, attr, fg + 30, bg + 40);
    return command;
}

颜色文件

#include <stdio.h>

#define CC_CONSOLE_COLOR_DEFAULT ""
#define CC_FORECOLOR(C) "[" #C "m"
#define CC_BACKCOLOR(C) "[" #C "m"
#define CC_ATTR(A) "[" #A "m"

namespace zkr
{
    class cc
    {
    public:

        class fore
        {
        public:
            static const char *black;
            static const char *blue;
            static const char *red;
            static const char *magenta;
            static const char *green;
            static const char *cyan;
            static const char *yellow;
            static const char *white;
            static const char *console;

            static const char *lightblack;
            static const char *lightblue;
            static const char *lightred;
            static const char *lightmagenta;
            static const char *lightgreen;
            static const char *lightcyan;
            static const char *lightyellow;
            static const char *lightwhite;
        };

        class back
        {
        public:
            static const char *black;
            static const char *blue;
            static const char *red;
            static const char *magenta;
            static const char *green;
            static const char *cyan;
            static const char *yellow;
            static const char *white;
            static const char *console;

            static const char *lightblack;
            static const char *lightblue;
            static const char *lightred;
            static const char *lightmagenta;
            static const char *lightgreen;
            static const char *lightcyan;
            static const char *lightyellow;
            static const char *lightwhite;
        };

        static char *color(int attr, int fg, int bg);
        static const char *console;
        static const char *underline;
        static const char *bold;
    };
}

颜色文件.cpp

#include "ccolor.h"

using namespace std;

namespace zkr
{
    enum Color
    {
        Black,
        Red,
        Green,
        Yellow,
        Blue,
        Magenta,
        Cyan,
        White,
        Default = 9
    };

    enum Attributes
    {
        Reset,
        Bright,
        Dim,
        Underline,
        Blink,
        Reverse,
        Hidden
    };

    char *cc::color(int attr, int fg, int bg)
    {
        static char command[13];
        /* Command is the control command to the terminal */
        sprintf(command, "%c[%d;%d;%dm", 0x1B, attr, fg + 30, bg + 40);
        return command;
    }

    const char *cc::console = CC_CONSOLE_COLOR_DEFAULT;
    const char *cc::underline = CC_ATTR(4);
    const char *cc::bold = CC_ATTR(1);

    const char *cc::fore::black = CC_FORECOLOR(30);
    const char *cc::fore::blue = CC_FORECOLOR(34);
    const char *cc::fore::red = CC_FORECOLOR(31);
    const char *cc::fore::magenta = CC_FORECOLOR(35);
    const char *cc::fore::green = CC_FORECOLOR(92);
    const char *cc::fore::cyan = CC_FORECOLOR(36);
    const char *cc::fore::yellow = CC_FORECOLOR(33);
    const char *cc::fore::white = CC_FORECOLOR(37);
    const char *cc::fore::console = CC_FORECOLOR(39);

    const char *cc::fore::lightblack = CC_FORECOLOR(90);
    const char *cc::fore::lightblue = CC_FORECOLOR(94);
    const char *cc::fore::lightred = CC_FORECOLOR(91);
    const char *cc::fore::lightmagenta = CC_FORECOLOR(95);
    const char *cc::fore::lightgreen = CC_FORECOLOR(92);
    const char *cc::fore::lightcyan = CC_FORECOLOR(96);
    const char *cc::fore::lightyellow = CC_FORECOLOR(93);
    const char *cc::fore::lightwhite = CC_FORECOLOR(97);

    const char *cc::back::black = CC_BACKCOLOR(40);
    const char *cc::back::blue = CC_BACKCOLOR(44);
    const char *cc::back::red = CC_BACKCOLOR(41);
    const char *cc::back::magenta = CC_BACKCOLOR(45);
    const char *cc::back::green = CC_BACKCOLOR(42);
    const char *cc::back::cyan = CC_BACKCOLOR(46);
    const char *cc::back::yellow = CC_BACKCOLOR(43);
    const char *cc::back::white = CC_BACKCOLOR(47);
    const char *cc::back::console = CC_BACKCOLOR(49);

    const char *cc::back::lightblack = CC_BACKCOLOR(100);
    const char *cc::back::lightblue = CC_BACKCOLOR(104);
    const char *cc::back::lightred = CC_BACKCOLOR(101);
    const char *cc::back::lightmagenta = CC_BACKCOLOR(105);
    const char *cc::back::lightgreen = CC_BACKCOLOR(102);
    const char *cc::back::lightcyan = CC_BACKCOLOR(106);
    const char *cc::back::lightyellow = CC_BACKCOLOR(103);
    const char *cc::back::lightwhite = CC_BACKCOLOR(107);
}

解决方案 8:

gon1332 标题的扩展版本:

//
//  COLORS.h
//
//  Posted by Gon1332 May 15 2015 on StackOverflow
//  https://stackoverflow.com/questions/2616906/how-do-i-output-coloured-text-to-a-linux-terminal#2616912
//
//  Description: An easy header file to make colored text output to terminal second nature.
//  Modified by Shades Aug. 14 2018

// PLEASE carefully read comments before using this tool, this will save you a lot of bugs that are going to be just about impossible to find.
#ifndef COLORS_h
#define COLORS_h

/* FOREGROUND */
// These codes set the actual text to the specified color
#define RESETTEXT  "" // Set all colors back to normal.
#define FOREBLK  "" // Black
#define FORERED  "" // Red
#define FOREGRN  "" // Green
#define FOREYEL  "" // Yellow
#define FOREBLU  "" // Blue
#define FOREMAG  "" // Magenta
#define FORECYN  "" // Cyan
#define FOREWHT  "" // White

/* BACKGROUND */
// These codes set the background color behind the text.
#define BACKBLK ""
#define BACKRED ""
#define BACKGRN ""
#define BACKYEL ""
#define BACKBLU ""
#define BACKMAG ""
#define BACKCYN ""
#define BACKWHT ""

// These will set the text color and then set it back to normal afterwards.
#define BLK(x) FOREBLK x RESETTEXT
#define RED(x) FORERED x RESETTEXT
#define GRN(x) FOREGRN x RESETTEXT
#define YEL(x) FOREYEL x RESETTEXT
#define BLU(x) FOREBLU x RESETTEXT
#define MAG(x) FOREMAG x RESETTEXT
#define CYN(x) FORECYN x RESETTEXT
#define WHT(x) FOREWHT x RESETTEXT

// Example usage: cout << BLU("This text's color is now blue!") << endl;

// These will set the text's background color then reset it back.
#define BackBLK(x) BACKBLK x RESETTEXT
#define BackRED(x) BACKRED x RESETTEXT
#define BackGRN(x) BACKGRN x RESETTEXT
#define BackYEL(x) BACKYEL x RESETTEXT
#define BackBLU(x) BACKBLU x RESETTEXT
#define BackMAG(x) BACKMAG x RESETTEXT
#define BackCYN(x) BACKCYN x RESETTEXT
#define BackWHT(x) BACKWHT x RESETTEXT

// Example usage: cout << BACKRED(FOREBLU("I am blue text on a red background!")) << endl;

// These functions will set the background to the specified color indefinitely.
// NOTE: These do NOT call RESETTEXT afterwards. Thus, they will set the background color indefinitely until the user executes cout << RESETTEXT
// OR if a function is used that calles RESETTEXT i.e. cout << RED("Hello World!") will reset the background color since it calls RESETTEXT.
// To set text COLOR indefinitely, see SetFore functions below.
#define SetBackBLK BACKBLK
#define SetBackRED BACKRED
#define SetBackGRN BACKGRN
#define SetBackYEL BACKYEL
#define SetBackBLU BACKBLU
#define SetBackMAG BACKMAG
#define SetBackCYN BACKCYN
#define SetBackWHT BACKWHT

// Example usage: cout << SetBackRED << "This text's background and all text after it will be red until RESETTEXT is called in some way" << endl;

// These functions will set the text color until RESETTEXT is called. (See above comments)
#define SetForeBLK FOREBLK
#define SetForeRED FORERED
#define SetForeGRN FOREGRN
#define SetForeYEL FOREYEL
#define SetForeBLU FOREBLU
#define SetForeMAG FOREMAG
#define SetForeCYN FORECYN
#define SetForeWHT FOREWHT

// Example usage: cout << SetForeRED << "This text and all text after it will be red until RESETTEXT is called in some way" << endl;

#define BOLD(x) "" x RESETTEXT // Embolden text then reset it.
#define BRIGHT(x) "" x RESETTEXT // Brighten text then reset it. (Same as bold but is available for program clarity)
#define UNDL(x) "" x RESETTEXT // Underline text then reset it.

// Example usage: cout << BOLD(BLU("I am bold blue text!")) << endl;

// These functions will embolden or underline text indefinitely until RESETTEXT is called in some way.

#define SetBOLD "" // Embolden text indefinitely.
#define SetBRIGHT "" // Brighten text indefinitely. (Same as bold but is available for program clarity)
#define SetUNDL "" // Underline text indefinitely.

// Example usage: cout << setBOLD << "I and all text after me will be BOLD/Bright until RESETTEXT is called in some way!" << endl;

#endif /* COLORS_h */

如您所见,它具有更多功能,例如可以临时、无限期地设置背景颜色等。我还认为它对初学者更友好,并且更容易记住所有功能。

#include <iostream>
#include "COLORS.h"

int main() {
  std::cout << SetBackBLU << SetForeRED << endl;
  std::cout << "I am red text on a blue background! :) " << endl;
  return 0;
}

只需将头文件包含在您的项目中,您就可以使用彩色终端输出进行摇滚了。

解决方案 9:

如果您的终端支持转义序列,则可以使用转义序列。例如:

echo []Hello, []colourful [world!]

解决方案 10:

尝试一下我的标题,以快速轻松地为文本着色:Aedi 的彩色标题

转义序列颜色标题

使用 C++ 在 Unix 中为您的输出着色!!

文本属性选项:

ATTRIBUTES_OFF, BOLD, UNDERSCORE, BLINK, REVERSE_VIDEO, CONCEALED

颜色选项:

BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE

格式:

通用格式,在$variable$中包含您想要的值

COLOR_$Foreground_Color$_$Background_Color$
COLOR_$Text_Attribute$_$Foreground_Color$_$Background_Color$
COLOR_NORMAL  // To set color to default

例如

COLOR_BLUE_BLACK // Leave Text Attribute Blank if no Text Attribute appied
COLOR_UNDERSCORE_YELLOW_RED
COLOR_NORMAL

用法:

只需在输出文本之前使用它来流式传输您想要的颜色,然后在输出文本后再次使用将颜色设置为正常。

cout << COLOR_BLUE_BLACK << "TEXT" << COLOR_NORMAL << endl;
cout << COLOR_BOLD_YELLOW_CYAN << "TEXT" << COLOR_NORMAL << endl;

解决方案 11:

您可以使用 ANSI 颜色代码。

使用这些功能。

enum c_color{BLACK=30,RED=31,GREEN=32,YELLOW=33,BLUE=34,MAGENTA=35,CYAN=36,WHITE=37};
enum c_decoration{NORMAL=0,BOLD=1,FAINT=2,ITALIC=3,UNDERLINE=4,RIVERCED=26,FRAMED=51};
void pr(const string str,c_color color,c_decoration decoration=c_decoration::NORMAL){
  cout<<"["<<decoration<<";"<<color<<"m"<<str<<"";
}

void prl(const string str,c_color color,c_decoration decoration=c_decoration::NORMAL){
   cout<<"["<<decoration<<";"<<color<<"m"<<str<<""<<endl;
}

解决方案 12:

仅作为侧节点,在带有 BASH shell 的 OSX 终端上,这对我来说有效(包括“红色文本”前面的 2 个空格):

$ printf "e[033;31m  red text
"
$ echo "$(tput setaf 1)  red text"

解决方案 13:

最好的方法是使用 ncurses 库 - 虽然如果你只想输出一个简单的彩色字符串,这可能是一个大难题

解决方案 14:

您可以编写直接控制颜色的ANSI 转义代码,也可以使用提供 API 的库(例如{fmt})。

例如:

#include <fmt/color.h>

int main() { 
  fmt::print(fg(fmt::color::crimson) | fmt::emphasis::bold,
             "Hello, {}!
", "world");
}

印刷

深红色粗体“你好,世界!”

大多数现代终端都支持 ANSI 转义序列,但您可以使用terminfo数据库进行检查。

解决方案 15:

我知道这个问题已经过时了,但我还是把这个答案贴出来给未来的读者。我用 C++ 编写了一个彩色输出库。它使用了操纵器,使工作变得简单,支持跨平台,但未经测试,这里是如何使用它的概述,

#include "srilakshmikanthanp/ANSI.hpp"

using namespace srilakshmikanthanp;

3 位和 4 位颜色:

// background
std::cout << ansi::BGyellow;
// foreground
std::cout << ansi::FGblue;
// output
std::cout << "Blue on yellow";
// reset
std::cout << ansi::reset;

8 位颜色:

// background
std::cout << ansi::BGcolor(157);
// foreground
std::cout << ansi::FGcolor(100);
// outpt
std::cout << "8 bit color";
// reset
std::cout << ansi::reset;

24 位色彩:

// background
std::cout << ansi::BGcolor(0, 255, 0);
// foreground
std::cout << ansi::FGcolor(0, 0, 255);
// output
std::cout << "24 bit color";
// reset
std::cout << ansi::reset;

字符串:

您可以使用以下方法轻松将此操纵符转换为字符串ansi::str

std::string BGyellow = ansi::str(ansi::BGyellow);
std::string FGblue = ansi::str(ansi::FGblue);
std::string reset = ansi::str(ansi::reset);

std::cout << BGyelow;
// foreground
std::cout << FGblue;
// output
std::cout << "Blue on Yellow";
// reset
std::cout << reset;

您可以通过上述链接在 github 上找到更多信息:)

解决方案 16:

我为此编写了一个跨平台库color_ostream,支持 ANSI 颜色、256 色和真彩色,您所要做的就是直接包含它并将 cout 更改为 rd_cout,就像这样。

标准基本颜色256 色真彩色
std::coutcolor_ostream::rd_coutcolor_ostream::rd256_coutcolor_ostream::rdtrue_cout
std::wcoutcolor_ostream::rd_wcoutcolor_ostream::rd256_wcoutcolor_ostream::rdtrue_wcout
std::cerrcolor_ostream::rd_cerrcolor_ostream::rd256_cerrcolor_ostream::rdtrue_cerr
std::wcerrcolor_ostream::rd_wcerrcolor_ostream::rd256_wcerrcolor_ostream::rdtrue_wcerr
性病::堵塞color_ostream::rd_clogcolor_ostream::rd256_clogcolor_ostream::rdtrue_clog
std::wclogcolor_ostream::rd_wclogcolor_ostream::rd256_wclogcolor_ostream::rdtrue_wclog

这是一个简单的例子:

//hello.cpp
#include "color_ostream.h"

using namespace color_ostream;

int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) {
    rd_wcout.imbue(std::locale(std::locale(),"",LC_CTYPE));
    rd_wcout << L"Hello world
";
    rd_wcout << L"Hola Mundo
";
    rd_wcout << L"Bonjour le monde
";

    rd256_wcout << L"
256 color" << std::endl;
    rd256_wcout << L"Hello world
";
    rd256_wcout << L"Hola Mundo
";
    rd256_wcout << L"Bonjour le monde
";

    rdtrue_wcout << L"
true color" << std::endl;
    rdtrue_wcout << L"Hello world
";
    rdtrue_wcout << L"Hola Mundo
";
    rdtrue_wcout << L"Bonjour le monde
";
    return 0;
}
相关推荐
  为什么项目管理通常仍然耗时且低效?您是否还在反复更新电子表格、淹没在便利贴中并参加每周更新会议?这确实是耗费时间和精力。借助软件工具的帮助,您可以一目了然地全面了解您的项目。如今,国内外有足够多优秀的项目管理软件可以帮助您掌控每个项目。什么是项目管理软件?项目管理软件是广泛行业用于项目规划、资源分配和调度的软件。它使项...
项目管理软件   601  
  华为IPD与传统研发模式的8大差异在快速变化的商业环境中,产品研发模式的选择直接决定了企业的市场响应速度和竞争力。华为作为全球领先的通信技术解决方案供应商,其成功在很大程度上得益于对产品研发模式的持续创新。华为引入并深度定制的集成产品开发(IPD)体系,相较于传统的研发模式,展现出了显著的差异和优势。本文将详细探讨华为...
IPD流程是谁发明的   7  
  如何通过IPD流程缩短产品上市时间?在快速变化的市场环境中,产品上市时间成为企业竞争力的关键因素之一。集成产品开发(IPD, Integrated Product Development)作为一种先进的产品研发管理方法,通过其结构化的流程设计和跨部门协作机制,显著缩短了产品上市时间,提高了市场响应速度。本文将深入探讨如...
华为IPD流程   9  
  在项目管理领域,IPD(Integrated Product Development,集成产品开发)流程图是连接创意、设计与市场成功的桥梁。它不仅是一个视觉工具,更是一种战略思维方式的体现,帮助团队高效协同,确保产品按时、按质、按量推向市场。尽管IPD流程图可能初看之下显得错综复杂,但只需掌握几个关键点,你便能轻松驾驭...
IPD开发流程管理   8  
  在项目管理领域,集成产品开发(IPD)流程被视为提升产品上市速度、增强团队协作与创新能力的重要工具。然而,尽管IPD流程拥有诸多优势,其实施过程中仍可能遭遇多种挑战,导致项目失败。本文旨在深入探讨八个常见的IPD流程失败原因,并提出相应的解决方法,以帮助项目管理者规避风险,确保项目成功。缺乏明确的项目目标与战略对齐IP...
IPD流程图   8  
热门文章
项目管理软件有哪些?
云禅道AD
禅道项目管理软件

云端的项目管理软件

尊享禅道项目软件收费版功能

无需维护,随时随地协同办公

内置subversion和git源码管理

每天备份,随时转为私有部署

免费试用