1. Open a developer command prompt. In Windows 8, on the Start screen, open the Visual Studio Tools folder and then choose the Developer Command Prompt shortcut. In earlier versions, choose the Start button, expand All Programs, Microsoft Visual Studio, and Visual Studio Tools, and then choose Developer Command Prompt.
Depending on the version of Windows on the computer and the system security configuration, you might have to open the shortcut menu for Developer Command Prompt and then choose Run as Administrator to successfully build and run the application that you create by following these steps.
2. In Notepad, enter the following lines:
1 2 3 4 5 6 |
#include int main() { printf("Hola Mundo.\n"); return 0; } |
3. At the command prompt, specify the cl command together with the name of your source file—for example, cl eje.c—and press Enter to compile the program. The cl.exe compiler generates an .obj file that contains the compiled code, and then runs the linker to build an executable program that has the name of your source file, but has an .exe file name extension—for example, simple.exe.
4. To run your program, type its name without the file name extension—for example, eje—and press Enter.