It’s not compiling! And I can’t find an answer!

Asked

Viewed 47 times

-4

Do not want to compile...

 #include <stdio.h>
    #include<stdlib.h>

    int main()
    {  
        system("title-Ajust System:Windows 7");//declarada-Title
        printf("SYSTEM 00.1-BETA\n\n");//-Name
        system("ver");//versão windows
        system("color 2");//cor

        for(system("time"))
   //Ajuste da Hora(Não está compilando)
       { 

          int time;

          if(time=0;time>0;time++)
          {
            printf("Erro ao alterar a hora...\n");//mensagem de erro
          }
          else
          {
           printf("Hora alterada com sucesso\n")//mensagem de hora alterada
          }

       }

       for (system("date"));//Ajuste da data(Não estou conseguindo compilar )
       {
        int date;

        if(date=0 ;date>0; date++)
           {
            printf("Erro ao alterar a data...\n");//mensagem de erro
           }
           else
           {
            printf("Data alterada com sucesso!\n");//mensagem de data alterada
           }
       }


       for(system("tree"));//manuseador de arquivos(também está dando erro)
       {
        int tree;

        if(tree=0; tree>0;tree++)
           {
            printf("Erro ao mostrar arquivos\n");//mensagem de erro
           }
           else
           {
            printf("arquivos abertos com sucesso!\n";)//mensagem de arquivos abertos
           }
       }

       /*
       Obs.:O programa tem como base manusear o sistema operacional com mais facilida
       de,caso tenha uma ideia continue com a linha de código...
       */

          return 0;
    }
  • 2

    This code does not compile because it is almost random, it would be interesting to study the subject a little more before trying to write something.

  • There is a semicolon missing in the second printf (there in the first Else)?

  • yeah thanks man!

1 answer

0

Well, I think there’s a lot wrong with that code. The structure of for, is wrong and should be if, and when there is if, that structure is for. I do not know what you intend to do, but it is obvious that this is wrong, and you use it in those conditions, and that implies that you do not perform what is within the for and the if. no if, this structure is used: if(condição), and is not used for(i=0;i<10;i++) for example, ie, will make a cycle from i=0 until i be less than 10, and will always walk +1. You are using no for if conditions, and no for if conditions, and may not have ; I think that’s why the code doesn’t compile

  • I usually do code anyway to fix after,but I was getting confused by the for and if conditions! thanks for the help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.