I know, this code is very simple and it's kind of ugly too, I'm a beginner and I'm trying to facilitate this function, can anyone tell me what the error is?
Image of the bug:
#include<stdio.h>#include<stdlib.h>#include<string.h>intmain(){chartempo[5],a[25];intop;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");
}