how to take integers as command line arguments?

后端 未结 7 1683
面向向阳花
面向向阳花 2020-12-08 10:52

I\'ve read a getopt() example but it doesn\'t show how to accept integers as argument options, like cvalue would be in the code from the example:



        
相关标签:
7条回答
  • 2020-12-08 11:39

    No, you can't just cast to convert it to an integer value. You need to transform it using sscanf, atoi, atol or similar function.

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