how to take integers as command line arguments?

后端 未结 7 1685
面向向阳花
面向向阳花 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:27

    atoi(), which means ascii to integer is the function to use. Similarly, atof() can be used to get float values.

提交回复
热议问题