Thread: whats wrong with this code?

  1. #1
    markdogg2
    Guest

    whats wrong with this code?

    there are errors on this- what are they? i dont know whats up.. thank you..

    #include <iostream.h>
    #include <iomanip.h>
    #include <conio.h>

    void main()
    {
    cout << "Hello World!";
    getch();
    }

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >void main()
    Wrong, main returns int, not void.

    >getch();
    Nonstandard, you may not have it.

    What errors are you getting because it compiles on my system, despite the program being completely undefined. Try this and see how it works:
    Code:
    #include <iostream> 
    
    int main() 
    { 
      std::cout<< "Hello World!"; 
      std::cin.get();
      return 0;
    }
    -Prelude
    My best code is written with the delete key.

  3. #3
    markdogg2
    Guest
    i get these errors-

    untitl~1.pas(76,1) Error: Illegal char constant
    untitl~1.pas(76,1) Fatal: There were 1 errors compiling module, stopping

  4. #4
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    get a better compiler. it shouldn't be doing that

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. what is wrong in this simple code
    By vikingcarioca in forum C Programming
    Replies: 4
    Last Post: 04-23-2009, 07:10 AM
  2. what is wrong with this code please
    By korbitz in forum Windows Programming
    Replies: 3
    Last Post: 03-05-2004, 10:11 AM
  3. I cant find what is wrong with this code
    By senegene in forum C Programming
    Replies: 1
    Last Post: 11-12-2002, 06:32 PM
  4. Anyone see what is wrong with this code?
    By Wise1 in forum C Programming
    Replies: 2
    Last Post: 02-13-2002, 02:01 PM
  5. very simple code, please check to see whats wrong
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 10-10-2001, 12:51 AM