How do you write to a document

This is a discussion on How do you write to a document within the C++ Programming forums, part of the General Programming Boards category; Originally posted by Tempest1 Still doesnt work lol, this sucks. What doesn't work? go above to abrege's post and copy ...

  1. #16
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    Originally posted by Tempest1
    Still doesnt work lol, this sucks.
    What doesn't work?

    go above to abrege's post and copy and paste that code, save, compile, run.
    you are using the newer mingw 3.2 compiler, so it needs to be iostream and not iostream.h. the .h will produce backwards warnings (although iostream.h should still run).
    also, did you d/l the right version with the compiler?

    How many errors? Try and read the errors also, that is what they are there for.

  2. #17
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    I havenít used the dev-c++ compiler, but to quote myself:

    I've used a handful of different compilers and my "out-of-the-box" experience has NEVER been very good! Getting that first "Hello World" (or other simple) program to compile has always been a pain! It's usually been a problem with the compiler being able to find the source file or the libraries, or me using the wrong command-line switches, or me not knowing where it put the exe file, etc.
    This can get VERY frustrating because the problem(s) / solutions(s) are undefined... not straight-forward... You never know if itís going to take an hour or a day to get everything working.

    I had to consult a couple of books (not included with the compiler) to get Microsoft Visual C++ set-up too!

    Hang in thereÖ it gets better after this!

    One more thing if you're using Windows... A lot of beginners have trouble with clicking on the exe file, and having the program run and the window close before they see what's displayed... so read the FAQ (if you haven't already) so you can avoid another frustration.

  3. #18
    Back after 2 years Panopticon's Avatar
    Join Date
    Dec 2002
    Posts
    262
    Before I got my VC++ I used Dev C++ and I dont recall it to be as troublesome as you make it out to be.
    there should be an execute button on the top left. You type the code and press the button as I recall.

    Nothing to it really.
    I AM WINNER!!!1!111oneoneomne

  4. #19
    Registered User
    Join Date
    Jan 2003
    Posts
    10
    Well you must recall a different version, you have to actually compile it first as i believe. I'll try all your suggestions later, im still confused anf frustrated and definetely wont get it but i promise i will try all your suggestions later. Thanks for all your help, i think youve pretty much helped all you could which is great. Thanks again.

  5. #20
    Registered User
    Join Date
    Dec 2002
    Posts
    119
    If no one has mentioned it, make sure you're compiling for a console program. In DevC++, Projects -> Project Options Make sure
    1) the "Compile C++" box is checked
    2) the "Do not create a console" is not checked

    Now try compiling and running it CTRL + F10

    Make sure your code looks like this:
    (I added the cin.get so the DOS window won't close directly your program terminates.)

    Code:
    #include <iostream>
    int main()
    {
        std::cout << "Hello World.\n";
        std::cin.get();
    }
    If you speak or are learning Spanish, check out this Spanish and English Dictionary, it is a handy online resource.
    What happens is not as important as how you react to what happens. -Thaddeus Golas

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling a script that can write information to a word document
    By superflygizmo in forum Game Programming
    Replies: 6
    Last Post: 02-14-2006, 04:27 PM
  2. Reroute where programs write to
    By willc0de4food in forum C Programming
    Replies: 7
    Last Post: 09-21-2005, 04:48 PM
  3. Document Class and Dialog Windows :: MFC
    By kuphryn in forum Windows Programming
    Replies: 3
    Last Post: 11-30-2002, 11:27 PM
  4. MultiDocument And MultView (and per document) :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 04-09-2002, 09:00 AM
  5. write in c
    By PutoAmo in forum C Programming
    Replies: 6
    Last Post: 04-03-2002, 06:53 PM

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