Thread: Why does this get no errors, yet still won't run? :mad:

  1. #1
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373

    Angry Why does this get no errors, yet still won't run? :mad:

    Why does this get a blank screen?
    __________________________________________________ __
    Code:
    #include <iostream>
    #include <string>
    #include <cstdlib>
    #include <stdlib.h>
    #include <windows.h>
    #include <stdio.h>
    #include <time.h>
    using namespace std;
    
    int Wait ( int Seconds );
    
    int main ( void )
    {
    char scan;
    while (scan != 'n');
    {
    string a("Norton anti virus scanning \n");
    string c("7 Hits\n");
    string d("Viruses found: 4\n");
    string e("Code red Worm\n");
    string f("Nimda Virus\n");
    string g("Love Bug Virus\n");
    string h("Kevlarsmart Worm\n");
    string j("Trojans: 3\n");
    cout << a;
    Wait (5);
    cout << c;
    Wait(3);
    cout << d;
    cout << e;
    cout << f;
    cout << g;
    cout << h;
    cout << "No files fixed\n";
    Wait(2);
    cout << j;
    cout << "No files fixed\n";
    Wait(4);
    cout << "Scan again? Y or N: ";
    cin >> scan;
    }
    }
    int Wait ( int Seconds )
    {
        clock_t endtime = clock() + Seconds * CLOCKS_PER_SEC;
        while ( ( clock() < endtime ) );
        return 0;
    }
    __________________________________________________ __
    This war, like the next war, is a war to end war.

  2. #2
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    and what's wrong with the friggin' code tags... oh, pardon.

    Code:
    #include <ostream>
    
    int main()
    {
    std::cout << "What's wrong with the friggin'code tag???";
    }
    This war, like the next war, is a war to end war.

  3. #3
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    OMG, it worked
    This war, like the next war, is a war to end war.

  4. #4
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    Thanks man. But it's not really scanning. just for fun. Where should i put "scan = 'y'"?
    This war, like the next war, is a war to end war.

  5. #5
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    Maybe you could tell me how to do password files. I wanna make the password if corect output 'correct'
    but i use while loops so it doesn't work.
    This war, like the next war, is a war to end war.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Segmentations and casting errors
    By Joke in forum C Programming
    Replies: 3
    Last Post: 07-14-2008, 04:52 PM
  2. Sneaky little linker errors...
    By Tozar in forum C++ Programming
    Replies: 8
    Last Post: 10-25-2006, 05:40 AM
  3. No errors, but wont run...
    By explosive in forum C++ Programming
    Replies: 17
    Last Post: 03-05-2004, 02:05 PM
  4. errors in class(urgent)
    By ayesha in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2001, 06:51 PM
  5. Spam :mad:
    By mithrandir in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 09-22-2001, 10:43 PM