C Macros to create strings

后端 未结 7 2130
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 04:37

Alternative Titles (to aid search)

  • Convert a preprocessor token to a string
  • How to make a char string from a C
相关标签:
7条回答
  • 2020-11-30 05:31

    I see lots of good and correct answers to your first question, but none to your second, so here's this: I think this is a terrible idea. Why should you have to rebuild your software (particularly the release version) just to change the server name? Also, how will you know which version of your software points at which server? You'll have to build in a mechanism to check at runtime. If it's at all practical on your platform, I recommend you load the domains/URLs from a config file. Only the smallest of embedded platforms may not be "practical" for that purpose :)

    0 讨论(0)
提交回复
热议问题