Thread: Can't Compile a Simple Program

  1. #16
    Registered User
    Join Date
    Feb 2002
    Posts
    5
    I think u can... anyone?

  2. #17
    Unregistered
    Guest
    Yes

  3. #18
    Unregistered
    Guest

    just do this

    Get a good code editor setup a template type thingy that looks like this

    #include <iostream.h>
    #include <stdio.h>
    /* Any other headers */

    int main(int argc, char* argv[])
    {
    /* code */
    return 0;
    }

    so when the editor loads up it puts that there at the same time...and yes you can have all the headers you want and yes cout is in iostream and puts printf and all those ones are in stdio so its easier to put both just in case...

  4. #19
    Registered User lukas1viper's Avatar
    Join Date
    Dec 2001
    Posts
    11

    Red face

    Use <iostream.h> instead of <stdio.h>. Iostream is used to print text, stdio is not.

    The program should look like this:

    Code:
    #include <iostream.h> 
    int main() 
    { 
    cout << "Hello World"; 
    return 0; 
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with simple, simple program.
    By LightsOut06 in forum C Programming
    Replies: 5
    Last Post: 09-01-2005, 08:31 PM
  2. Problem with simple XOR program
    By spike_ in forum C++ Programming
    Replies: 8
    Last Post: 08-17-2005, 12:09 AM
  3. simple frontend program problem
    By gandalf_bar in forum Linux Programming
    Replies: 16
    Last Post: 04-22-2004, 06:33 AM
  4. How To Embed Data In Program While Compile?
    By ooosawaddee3 in forum C++ Programming
    Replies: 1
    Last Post: 09-09-2002, 10:14 AM
  5. how do i compile a program that deals w/classes?
    By Shy_girl_311 in forum C++ Programming
    Replies: 5
    Last Post: 11-11-2001, 02:32 AM