I need to create a program that creates another program but not a compiler though.
For example,
I write a program that accepts a string input from the user. Let’s say user enter “Pluto”. This program should then create a separate .exe that says “Hello Pluto” when executed.
How can I do this? If you could give example in C# and Windows Forms, it’s better.
Thanks.
Basically that is a compiler – just for a particularly simple language.
If you can express the final program in C#, the easiest solution is probably to use CSharpCodeProvider. That’s what I do for Snippy, a little tool to help run code snippets easily for C# in Depth. The source code to Snippy is on the C# in Depth web site and can give you an idea of what you might do – basically you’d just want it to write the executable to a file instead of building it in memory.
Alternatively, look at the MSDN docs which have an example generating an executable.