Results 1 to 10 of 10

Thread: plz ** PLZ HELP A NEWBIE!**

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Posts
    28

    plz ** PLZ HELP A NEWBIE!**

    1. I have a problem... I dont understand how to write out the time. Cant somebody write me a prog thats show the time, that i can learn from, PLZ

    i know this:
    #include <iostream.h>

    int main()
    {
    cout << "TIME HERE!";
    return 0;
    }


    2. this heder? stdafx.h what does it do?

    PLZ HELP ME!
    Last edited by Chs; Oct 20th, 2002 at 01:24 PM.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Why don't you try yourself first? You learn much more by trying than by looking at, especially when you want to learn a programming language.

    parksie already gave you the right direction.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Posts
    28

    PLZ PLZ PLZ PLZ

    i only get a lot of errors, plz help me... i will buy a book i a day or two, but PLZ help me! PLZ PLZ PLZ!

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    The stdafx.h header is an invention of Microsoft. You should always use an empty project when you start, then add files. This way you don't have the confusing stdafx.h around.


    You should use <iostream>, not <iostream.h>. The .h is deprecated and not used for C++ headers anymore.

    The code should look like this:
    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
    cout << "TIME HERE!";
    return 0;
    }
    Whenever you post code you should wrap it in [ code]...[/ code] tags so it keeps it's formatting.

    About the time: again, look up the time() function in the VC++ reference. You'll learn which header to include and how to use it.
    To get a string out of a time_t, use the ctime() function. Look it up too.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Posts
    28
    I CANT FIND IT! OK! Let me explain, i have a downloaded copy of a DOS complier! DJGPP! It havent got a references, or i dont know how to read it, not the MSDN! PLZ! Wite me a code!

    PLZ!

    P.S using namespace std; whats that?
    Last edited by Chs; Oct 20th, 2002 at 02:07 PM.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Can't remember what version of GCC DJGPP corresponds with.

    I would suggest getting a proper Windows compiler. Failing that, move to an OS that has proper development support *grin*

    Ok, so maybe not that last one.

    But you want a compiler with full Standard C++ Library support or you *will* have problems.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    New Member
    Join Date
    Jan 2001
    Posts
    11
    Give this this link a try.

    Later

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Go to the borland page and download their command line compiler. It's a full-blown optimizing C++ Win32 compiler with support for the newest C++ ANSI standard and standard library. And it's free, all you have to do is fill out a form (make sure you've got a junk mail address, or get one from hotmail or something comparable)
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I DJGPP goes around somewhere of gcc 2.0, maybe some later 1.x, don't exactly know.

    Anyway, it's quite old and it's definitly not standards compliant anymore.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    http://www.vbforums.com/showthread.p...hreadid=206639

    For an explanation of
    using namespace std;
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width