r/C_Programming • u/crisrb13yt • Oct 14 '26
Question Beginner in C — need help compiling my program on Windows.
#include <stdio.h>
int main(void) {
int opcao;
do {
printf("\n=======================\n");
printf(" TECNFIX INFORMATICA\n");
printf("=======================\n");
printf(" 1 - Cadastrar Cliente\n");
printf(" 2 - Cadastrar equipamentos\n");
printf(" 3 - abrir Ordem de Serviço\n");
printf(" 4 - Consultar Ordem de Serviço\n");
printf(" 5 - Sair\n");
printf("===============================\n");
printf("Escolha uma opcao:");
scanf("%d", &opcao);
switch (opcao) {
case 1:
printf("Cadastro Clientes selecionados!\n");
break;
case 2:
printf("Cadastro de equipamentos selecionados!\n");
break;
case 3:
printf("abrir Ordem de Serviço!\n");
break;
case 4:
printf("Consultar Ordens de Serviço selecionado!\n");
break;
case 5:
printf("Encerrando o sistema TechFix...\n");
break;
default:
printf("Opcao invalida!. Tente novamente.\n");
}
} while (opcao != 5);
return 0;
}
0
Upvotes
12
u/dkopgerpgdolfg Oct 14 '26
So, where are you stuck?
11
u/KeyAdhesiveness9481 Oct 14 '26
In general, "i tried X, I expected Y, i observed Z" is a good format for asking for help.
6
u/Own_Unit_6170 Oct 14 '26
Install the community version of Microsoft Visual Studio. It's free.
2
u/SmokeMuch7356 Oct 14 '26
What have you tried so far?
0
u/orbiteapot Oct 14 '26
Que compilador você tem? Eu recomendo o MinGW.
1
u/Legal-Demand-966 Oct 14 '26
Use vs code with c/c++ and runner extension
1
u/NYU_VM Oct 14 '26
No way to know what you have in terms of tools/compilers or what specifically you are trying to ask? You need compilers? Grab the gcc or clang toolchains provided by MSYS2. Or get an ide like Visual Studio. You want to use the command line? Use "gcc/clang filename.c". And for your code, improve it to follow a defensive style of coding, it's a bio hazard waiting to happen. Do not just look at the happy paths and just test by entering numbers 1 through 5. Input Anything else and it would be UB or some form of failure,..
1
u/e-batters Oct 18 '26
Why, instead of Visual Studio Code, not opt for a real IDE? With Visual Studio Community, there is an edition of this IDE that is ‘free for students, open-source contributors, and individuals.’. If you want I can provide you with a pre-configured sample project that will directly allow you to compile your program.
-2
u/Shattered-Spears Oct 14 '26
Use "Code Blocks"