-1
I know, this code is very simple and this bit ugly tbm, I am beginner and I am trying to facilitate this function, someone can tell me what the mistake?
Screenshot of the bug:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char tempo[5],a[25];
int op;
printf("EAE MEN\n\n1.Apagar o bixin\n2.Desligar e ligar dnv\n3.Tirar uma sonequinha\n");
scanf("%d",&op);
switch(op){
case 1:
a=="shutdown -s -t ";
printf("Desliga em qts segundos msm?\n");
scanf(" %s",tempo);
strcat(a,tempo);
break;
case 2:
a=="shutdown -r -t ";
printf("Reinicia em qts segundos msm?\n");
scanf(" %s",tempo);
strcat(a,tempo);
break;
case 3:
a=="shutdown -h -t ";
printf("Sonequinha em qts segundos msm?\n");
scanf(" %s",tempo);
strcat(a,tempo);
break;
default:
printf("Numero Invalido, bro, sabe ler n eh?\n");
return 0;
}
system(a);
return 0;
system("pause");
}
It would be nice [Dit] and put the code in the question. External references should only be used as a complement (and this is better for those who help you already see the whole problem in one place). Also, it is better to post the error as text, not as image.
– Bacco
Instead of error photos you can copy the error and paste it directly here, out that this is not a BUG but an error of your own, BUG would be if it was a failure in the C compiler you use, but the case ae is a mistake of yours. Read: Post code as image
– Guilherme Nascimento