Saturday, May 19, 2018

windows - C++ executing DOS commands doesn't work

I want to run DOS commands in a C++ program but I don't know exactly how.
This is my code:



#include "stdafx.h"
#include
void main()
{
system("c:\wmic os get Version");
}



But this is what it shows:



1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Users\rares992\Documents\Visual Studio 2010\Projects\project_scs\Debug\project_scs.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.20

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


*I run it with Microsoft Visual Studio 2010.



Can anyone tell me what is wrong and what should I do? Thankyou.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...