|
|
|
|
 |
|

April 20th, 2005, 01:16 PM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: OT: Look what I can do...
Yeah, that program is all wrong.
|

April 20th, 2005, 02:15 PM
|
 |
Lieutenant Colonel
|
|
Join Date: Jan 2004
Location: Minnesota/South Dakota
Posts: 1,439
Thanks: 3
Thanked 3 Times in 3 Posts
|
|
Re: OT: Look what I can do...
I don't believe you can legally have a first C++ program without it including "Hello World". 
__________________
You can give a man fire and he will be warm for a day but set him on fire and he will be warm for the rest of his life.
A* Se+++ GdQ $? Fr! C* Css Sf-- Ai% Au M+++ Mp* S@ Ss++++ RNSHP Pw++ Fq+++ Nd++ Rp++ G++++ Mm++ Bb+++@ L+ Tcp--
Get the newest Version of Invasion! here: http://www.secenter.org/

|

April 20th, 2005, 02:45 PM
|
 |
Major
|
|
Join Date: Jan 2004
Location: Taganrog, Russia
Posts: 1,087
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Look what I can do...
It only means that geo's really first programm was written in Basic.
But he will never admit it 
|

April 20th, 2005, 03:38 PM
|
 |
Second Lieutenant
|
|
Join Date: Mar 2005
Location: Seattle, WA
Posts: 417
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Look what I can do...
|

April 20th, 2005, 03:41 PM
|
|
Sergeant
|
|
Join Date: Sep 2004
Location: Belgium
Posts: 222
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Look what I can do...
Lemme tell you, that is C  not C++ it might be C++ syntax but C++ implies OO programming. dunno if you guys see that.
having a single main aint a good sign
but if it's meant to be procedural it looks like a well structured program.
|

April 20th, 2005, 03:42 PM
|
 |
Shrapnel Fanatic
|
|
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
|
|
Re: OT: Look what I can do...
C++ is not strictly object oriented. It is well suited for procedural programming (more so than the ever so clunky C). 
|

April 20th, 2005, 04:03 PM
|
 |
National Security Advisor
|
|
Join Date: Jan 2001
Location: Ohio
Posts: 8,450
Thanks: 0
Thanked 5 Times in 2 Posts
|
|
Re: OT: Look what I can do...
Aww you guys are tough.
Yeah we did the "Hello world" stuff in class. Everything up to this point was copying down code that the instructor did or doing the step by step stuff in the book. This one was the first one that I wrote on my own. All I had to work with was what the input and required output was supposed to look like.
And as far as it being C instead of C++, all I have to say to that is, even better. I'm bilingual! 
__________________
I used to be somebody but now I am somebody else
Who I'll be tomorrow is anybody's guess
|

April 20th, 2005, 04:16 PM
|
 |
Second Lieutenant
|
|
Join Date: Mar 2005
Location: Seattle, WA
Posts: 417
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Look what I can do...
Suggestion for version 2:
Separate input, output and processing into their own functions. It's real good exercise. Something like
main(){
get_input( variables )
process_input( variables )
put_output(screen)
put_output(file)
}
My brother never learned to use functions, and now he codes his entire programs all in main().
So now he can't write big programs, because after a while it becomes too much to follow in one function.
Try reading a 500-line function! One page is plenty.
|

April 20th, 2005, 10:17 PM
|
 |
General
|
|
Join Date: Jan 2003
Location: Atlanta, GA
Posts: 3,499
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Look what I can do...
Gotta take my hat off to anyone who's got the initiative to learn a programminglanguage this "late in the game". 
__________________
ALLIANCE, n. In international politics, the union of two thieves who have their hands so deeply inserted in each other's pocket that they cannot separately plunder a third. (Ambrose Bierce)
|

April 20th, 2005, 10:16 PM
|
 |
Lieutenant Colonel
|
|
Join Date: Mar 2001
Location: Emeryville, CA
Posts: 1,412
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Look what I can do...
Quote:
boran_blok said:
Lemme tell you, that is C not C++ it might be C++ syntax but C++ implies OO programming. dunno if you guys see that.
having a single main aint a good sign 
but if it's meant to be procedural it looks like a well structured program.
|
Ah, but there are objects. He clearly uses both the pre-defined cin and cout for standard input and standard output, respectively, and also uses the class ofstream for file output. Just because he hasn't created a class doesn't mean it's not OOP. I think Java has started to rot people's minds, making programmers think something is never OO unless you type "class foo" somewhere...
And I don't know about the rest of you, but I started in C, at 14 years old. A year later I learned "BASIC", but it was the version in my TI calculator, not this Visual nonsense. I technically still haven't "learned" VB, but really, do I need to? I can read the stuff, and if I'm ever asked to write it for some horrid reason... well, I'll burn that bridge when I get to it.
__________________
GEEK CODE V.3.12: GCS/E d-- s: a-- C++ US+ P+ L++ E--- W+++ N+ !o? K- w-- !O M++ V? PS+ PE Y+ PGP t- 5++ X R !tv-- b+++ DI++ D+ G+ e+++ h !r*-- y?
SE4 CODE: A-- Se+++* GdY $?/++ Fr! C++* Css Sf Ai Au- M+ MpN S Ss- RV Pw- Fq-- Nd Rp+ G- Mm++ Bb@ Tcp- L+
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|