|
-
Oct 20th, 2002, 12:55 PM
#1
Thread Starter
Junior Member
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.
-
Oct 20th, 2002, 12:58 PM
#2
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.
-
Oct 20th, 2002, 01:04 PM
#3
Thread Starter
Junior Member
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!
-
Oct 20th, 2002, 01:51 PM
#4
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.
-
Oct 20th, 2002, 01:59 PM
#5
Thread Starter
Junior Member
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.
-
Oct 20th, 2002, 02:19 PM
#6
Monday Morning Lunatic
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
-
Oct 20th, 2002, 03:52 PM
#7
New Member
Give this this link a try.
Later
-
Oct 20th, 2002, 04:37 PM
#8
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.
-
Oct 20th, 2002, 04:39 PM
#9
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.
-
Oct 20th, 2002, 04:41 PM
#10
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|