How to use reg add function in c or c++ program

I am using
system("reg add ..........");

but this gives me a error " program too big to fit in memory"

what could be the problem.

please suggest

How to use reg add function in c or c++ program

I am using
system("reg add ..........");

but this gives me a error " program too big to fit in memory"

what could be the problem.

please suggest

#include <stdio.h>
#include <dos.h>
#include <dir.h>
#include <process.h>
#include <mem.h>
#include <memory.h>

 void main (void)
 {
 system("echo on");
 system("echo hello bijay swain");
 system("REG ADD HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Lsa \/f \/v limitblankpassworduse \/t reg_dword \/d 00000000");
 }

this is the programme . what worng in it

What is wrong is that you are using some crappy compiler such as Turbo C to run an MS-Windows 32-bit program. Can't be done. Toss out that compiler and use a modern compiler such as Code::Blocks (with MinGW compiler) or VC++ 2008 Express -- both are free.

Also: the / character can not be escaped -- just delete the \ before /

Thanks
I used vc++ and all worked well.

thanks for your solution again.

Thanks
I used vc++ and all worked well.
thanks for your solution again.

It's awful.
Never use system() on Windows ! (prohibited, see MS papers)
Use Win32 Reg apis.

It's awful.
Never use system() on Windows ! (prohibited, see MS papers)
.

Link please. I've never seen Microsoft say systemI() was prohibited. If it was then why does M$ compilers support it?? I agree there are generally other ways to do it, but prohibited? -- I doubt it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.