sprintf_s was not declared in this scope

前端 未结 6 1241
悲&欢浪女
悲&欢浪女 2021-01-01 10:28

I have a C program that uses sprintf_s. It works fine in Windows, but when I compile my code in Linux it gives this error:

sprintf_s was not dec         


        
6条回答
  •  星月不相逢
    2021-01-01 11:09

    sprintf_s is not part of the standard C library, so it is not portable, thus you are not able to use it in Linux. BUT you have snprintf, which is very similar and it should help you to accomplish what you want.

提交回复
热议问题