Results 1 to 3 of 3

Thread: Completely random errors...

  1. #1

    Completely random errors...

    To me at least. Some of you may remember the old CPU burner I posted, written in C++, awhile back... well, after learning a bit of x86, I decided to really make it burn .


    Code:
    #include <iostream>
    #include <stdlib.h>
    
    using namespace std;
    
    char characterToCompare;
    char compare1 = "y";
    //char compare2 = "n";
    
    //======BURNER======//
    
    void burnerFunction()
    {
     cout << "Burning...";
        asm(".intel_syntax noprefix"
    "mov ecx,999999999999999"
    "mov edi,0"
    "mov esi,0"
    "mov eax,0"
    "mov ebx,0"
    "mov edx,0"
    
    "burnLoop:"
    "inc edi"
    "inc esi"
    "inc eax"
    "inc ebx"
    "inc edx"
    "dec edi"
    "dec esi"
    "dec eax"
    "dec ebx"
    "dec edx"
    "push edi"
    "push esi"
    "push eax"
    "push ebx"
    "push edx"
    "pop edx"
    "pop ebx"
    "pop eax"
    "pop esi"
    "pop edi"
    "loop burnLoop");
    
    cout << "Done burning.\n\n";
    
    system("pause");
    
    }
    
    
    int main()
    
    {
        cout << "Welcome to the Burninator! Enter \"y\" to continue, or anything else" \
        "to escape:\n> ";
        cin >> characterToCompare;
       
        if(characterToCompare == compare1)
         {
             burnerFunction; //Call the burner function
             
         }
         
        else
         {
             return 0;
             
         }
         
         return 0;
         
     }
    The errors I'm getting:

    7 C:\Dev-Cpp\burn-main.cpp invalid conversion from `const char*' to `char'

    8 C:\Dev-Cpp\burn-main.cpp invalid conversion from `const char*' to `char'

    C:\Dev-Cpp\burn-main.cpp In function `int main()':

    62 C:\Dev-Cpp\burn-main.cpp [Warning] statement is a reference, not call, to function ` burnerFunction()'

    C:\Dev-Cpp\Makefile.win [Build Error] [burn-main.o] Error 1



    So, anybody know what I did wrong this time?
    Tell me if you think I\'m spamming or doing something stupid, please.

  2. #2
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    It's been a while but:

    char compare1 = "y";
    char compare1 = 'y'; // Note the different quotes

    Not sure about the other error. Did you try burnerFunction() instead?
    It's a warning not an error so it should still compile and run anyway.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  3. #3
    Custom User
    Join Date
    Oct 2001
    Posts
    503
    Like SirDice guessed, "burnerFunction;" should be "burnerFunction();"

    Just my opinion, but this program looks fairly pointless.

    ac

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •