correct the code

whats wrong in this code

1
2
3
4
5
6
7
8
9
#include <stdio.h>
 #include <dos.h>
 #include <dir.h>
 #include <process.h>

 void main (void)
 {
 system ("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Lsa"" \/f \/v limitblankpassworduse \/t reg_dword \/d 00000000");
 }
Last edited on
closed account (S6k9GNh0)
I will not read your code next time if you don't read this: http://cplusplus.com/forum/articles/16853/

1. This is the most pointless C based program I've ever seen.
2. The main definition is 'int main(void)' or 'int main(int, char**)', not 'void main(void)'.
3. Most of your headers aren't needed.
4. The use of system() makes me lol.

Easy Suggestion: Make a batch script instead of making an entire C++ application if you want to use commands to edit registry keys.

Intermediate Suggestion: Use calls to the WinAPI to change the registry natively.

Difficult and Opinionated Suggestion: Don't use the registry as it's an embarrassment to mankind.
Last edited on
there's also an odd 'i' before main in your code
and see http://msdn.microsoft.com/en-us/library/ms724871%28VS.85%29.aspx
Topic archived. No new replies allowed.