search

Home  >  Q&A  >  body text

弱弱问一句c++中两个%什么意思?

#define FILE_ICON "%APPPATH%,1"

%APPPATH% 是指?为什么两边要加上%

怪我咯怪我咯2805 days ago619

reply all(6)I'll reply

  • PHPz

    PHPz2017-04-17 11:13:10

    This %APPPATH% represents the environment variable of the Windows system, which is used to save the path and has nothing to do with C itself

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 11:13:10

    is just an ordinary string in C .

    This string should be used to represent Windows environment variables. Windows environment variables have percent signs at the beginning and end.

    reply
    0
  • PHPz

    PHPz2017-04-17 11:13:10

    The % sign is only useful when formatting with printf, but only one is needed. If you are not formatting a string, just use it as an ordinary character, a raw character, which has no special meaning.

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 11:13:10

    If you want to get the value of a windows environment variable, you need to use the getenv function

    const char* pAppPath = getenv("APPPATH");
    

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 11:13:10

    Variables in Windows system paths are identified by double percent signs. %APPPATH% should be the path to the application.

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 11:13:10

    You can refer to the process of configuring the development environment in Java under win, and you will understand

    reply
    0
  • Cancelreply