Defining own main functions arguments argc and argv

前端 未结 6 2354
野性不改
野性不改 2020-12-09 15:16

i want to create an object of type QApplication which needs the main functions arguments argc and argv as an input:

QApplication app(argc, argv);
         


        
6条回答
  •  粉色の甜心
    2020-12-09 16:14

    Why are you concerning your self with the size of the text in argv, I would just let the compiler do it:

    int argc = 1;
    char* argv[] = {"Hello Qt!"}; // exactly as it is defined in main
    

提交回复
热议问题