Two 'main' functions in C/C++

后端 未结 16 1465
一整个雨季
一整个雨季 2020-12-01 16:08

Can I write a program in C or in C++ with two main functions?

16条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 16:51

    The idiom is to dispatch on the value of argv[0]. With hardlinks (POSIX) you don't even lose diskspace.

提交回复
热议问题