Whats Wrong Whith This!?

This is a discussion on Whats Wrong Whith This!? within the C++ Programming forums, part of the General Programming Boards category; whats wrong with this program??? Code: #include <wait.h> #include <iostream.h> #include <stdlib.h> #include <stdio.h> { printf(" _______ "); wait(1); printf(" ...

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    11

    Whats Wrong Whith This!?

    whats wrong with this program???
    Code:
    #include <wait.h>
    #include <iostream.h>
    #include <stdlib.h>
    #include <stdio.h>
    
    {
    	
    	
    	
    	printf("                                       _______                                        ");
    	wait(1);
    	printf("                                      /        /                                 ");
    	wait(1);
    	printf("                                    /            /                            ");
    	wait(1);
    	printf("                                  /                /                           ");
    	wait(1);
    	printf("                                /                    /                          ");
    	wait(1);
    	printf("                              /       __    __         /                       ");
    	wait(1);
    	printf("                            /        |  |  |  |          /                      ");
    	wait(1);
    	printf("                          /          |__|  |__|            /                    ");
    	wait(1);
    	printf("                        /                                    /                  ");
    	wait(1);
    	printf("                      /                                        /                ");
    	wait(1);
    	printf("                    /                     /                      /              ");
    	wait(1);
    	printf("                   |                     /                                      ");
    	wait(1);
    	printf("                   |                    /____                    |      ");
    	wait(1);
    	printf("                   |                                             |     ");
    	wait(1);
    	printf("                   |                                             |    ");
    	wait(1);
    	printf("                   |                                             |      ");
    	wait(1);
    	printf("                     /                                          /     ");
    	wait(1);
    	printf("                       /                            ^         /      ");
    	wait(1);
    	printf("                         /                         /        /         ");
    	wait(1);
    	printf("                           /         ____________/        /          ");
    	wait(1);
    	printf("                             /                          /              ");
    	wait(1);
    	printf("                               /                      /                ");
    	wait(1);
    	printf("                                 /                  /                  ");
    	wait(1);
    	printf("                                   /              /                    ");
    	wait(1);
    	printf("                                     /          /                    ");
    	wait(1);
    	printf("                                       /______/                 ");
    	wait(1);
    	printf("                                                                               ");
    	wait(1);
    	printf("                                                                               ");
    	wait(1);
    	printf("                                                                               ");
    	wait(1);
    	printf("                                                                               ");
    	wait(1);
    
    
    
    
    
    
    	return 0;
    
    }
    Children in the dark make accidents.

    Accidents in the dark make children.

  2. #2
    Registered Luser
    Join Date
    Apr 2003
    Posts
    17
    1. No int main().
    2. Use of pre-standard and deprecated headers, etc.

  3. #3
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    You wouldn't need the spaces after the last visible character in each string.

  4. #4
    Registered User
    Join Date
    Jan 2003
    Posts
    311
    You probably want some newlines as well.

  5. #5
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Using printf instead of cout.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  6. #6
    Registered User
    Join Date
    May 2003
    Posts
    11
    im using printf instead of cout so the timer would work
    Children in the dark make accidents.

    Accidents in the dark make children.

  7. #7
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    i dont have wait.h so i cant test but this should work

    Code:
    #include <cwait>
    #include <iostream>
    #include <cstdlib>
    #include <cstdio>
    
    using namespace std;
    
    int main()
    {
    	
    	
    	
    	printf("                                       _______                                        ");
    	wait(1);
    	printf("                                      /        /                                 ");
    	wait(1);
    	printf("                                    /            /                            ");
    	wait(1);
    	printf("                                  /                /                           ");
    	wait(1);
    	printf("                                /                    /                          ");
    	wait(1);
    	printf("                              /       __    __         /                       ");
    	wait(1);
    	printf("                            /        |  |  |  |          /                      ");
    	wait(1);
    	printf("                          /          |__|  |__|            /                    ");
    	wait(1);
    	printf("                        /                                    /                  ");
    	wait(1);
    	printf("                      /                                        /                ");
    	wait(1);
    	printf("                    /                     /                      /              ");
    	wait(1);
    	printf("                   |                     /                                      ");
    	wait(1);
    	printf("                   |                    /____                    |      ");
    	wait(1);
    	printf("                   |                                             |     ");
    	wait(1);
    	printf("                   |                                             |    ");
    	wait(1);
    	printf("                   |                                             |      ");
    	wait(1);
    	printf("                     /                                          /     ");
    	wait(1);
    	printf("                       /                            ^         /      ");
    	wait(1);
    	printf("                         /                         /        /         ");
    	wait(1);
    	printf("                           /         ____________/        /          ");
    	wait(1);
    	printf("                             /                          /              ");
    	wait(1);
    	printf("                               /                      /                ");
    	wait(1);
    	printf("                                 /                  /                  ");
    	wait(1);
    	printf("                                   /              /                    ");
    	wait(1);
    	printf("                                     /          /                    ");
    	wait(1);
    	printf("                                       /______/                 ");
    	wait(1);
    	printf("                                                                               ");
    	wait(1);
    	printf("                                                                               ");
    	wait(1);
    	printf("                                                                               ");
    	wait(1);
    	printf("                                                                               ");
    	wait(1);
    
    	return 0;
    
    }

  8. #8
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    A) iostream isn't needed.

    B) There's no such header as cwait. The cwhatever header files are only the Standard C header files that were brought into C++.

    C) Try using Sleep(1000); instead of wait(1); and include windows.h instead of wait.h.

  9. #9
    Registered User
    Join Date
    Mar 2003
    Posts
    73
    Also \n's would make it look better, so that it's not just attempted to be placed on one line....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 03:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 09:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 12:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 11:01 AM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21