Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > n00b help

Reply
Thread Tools

n00b help

 
 
Ron Natalie
Guest
Posts: n/a
 
      10-27-2004
Howard wrote:

> <rant>
>
> Ever used CodeWarrior? In order to maintain compatibility with OS9, they
> sttill give you a void main() function when creating a project. It's not a
> matter of someone "telling you" it's right, it's just what you get when
> starting a project. Granted, it's non-standard, and ought to be changed
> (both by the user and by Metrowerks), but in the context in which it was
> used, it's correct, in that it compiles and executes without error


<RANT> Who the hell cares. If you have to bend over to support a non-standard
compiler, that's fine. Howevever, we recommend the standard language
here. Frankly, it's got nothing to do with OS9 but everything to do
with CodeWarriors poor implementation. Whether nor not the OS has a
return value, main still needs to be an int-returning function.

Simmilarly for your other issues. The idea is people come here for
instruction. Telling them to do non-standard things just because some
compilers support it isn't productive.
 
Reply With Quote
 
 
 
 
Christo
Guest
Posts: n/a
 
      10-27-2004

"John Harrison" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Christo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> "John Harrison" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >
>> > "Christo" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >>
>> >>
>> >> we have not covered strings in the intro to c++ course yet at uni,
>> >> just
>> > int,
>> >> float and char, so i havent used them, i dont want to get confused

> early
>> > on,
>> >> even though i have programmed before with vb and used php i think c++

> is
>> >> going to be a step up for me.
>> >>
>> >> I got the program working with one minor problem... whenever i get my
>> > answer
>> >> it prints this line regardless if i input the correct operator (+ - *

> /)
>> >>
>> >
>> > It doesn't when I run it. And nor can I see any reason that it would. I
>> > think you must be mistaken, probably the code you have posted and the

> code
>> > you are running are not the same.
>> >
>> > And please drop all those silly endl
>> >
>> > cin >> cCmd; endl;
>> >
>> > This endl is doing NOTHING.
>> >
>> > And replace all the other endl with \n
>> >
>> > cout << "Help File" << endl;
>> >
>> > should be
>> >
>> > cout << "Help File\n";
>> >
>> > john
>> >
>> >

>>
>> ok thank you, i have just been taught that i thought endl; took you onto
>> a
>> new line, i am not using a GUI for this just the console, at the minute i

> am
>> a begginner
>>

>
> endl does take you to a new line on output (it does nothing on input) but
> so
> does '\n'. The difference is that \n is easier to type and that endl as
> well
> as taking you to a newline also flushes the output stream. Almost all the
> time you don't care about flushing the output stream, maybe you don't even
> know what it means.
>
> cin >> cCmd; endl;
>
> is just plain wrong, endl has no meaning on input, and if this exercise is
> being marked you'll lose marks for that.
>
> cout << "Help File" << endl;
>
> is OK, but it flushes the output stream for no obviously good reason. To
> me
> it just seems like one of those things that gets copied (or taught) for no
> discernable reason but everyone ends up doing it anyway.
>
> But anyway, the main thing is that you got your program working. Did you
> sort out why that extra line was always appearing?
>
> john
>


oh damn i am stupid i didnt realize i had it on the cin

haha

not yet no, i am thining it might just be my machine, stuck it on my account
at uni so i check it out on friday and ask me lecturer about it.

Thanks for the info


 
Reply With Quote
 
 
 
 
Howard
Guest
Posts: n/a
 
      10-27-2004

"Ron Natalie" <(E-Mail Removed)> wrote in message
news:417fd73f$0$28258$(E-Mail Removed) m...
> Howard wrote:
>
>> <rant>
>>
>> Ever used CodeWarrior? In order to maintain compatibility with OS9, they
>> sttill give you a void main() function when creating a project. It's not
>> a matter of someone "telling you" it's right, it's just what you get when
>> starting a project. Granted, it's non-standard, and ought to be changed
>> (both by the user and by Metrowerks), but in the context in which it was
>> used, it's correct, in that it compiles and executes without error

>
> <RANT> Who the hell cares. If you have to bend over to support a
> non-standard
> compiler, that's fine. Howevever, we recommend the standard language
> here. Frankly, it's got nothing to do with OS9 but everything to do
> with CodeWarriors poor implementation. Whether nor not the OS has a
> return value, main still needs to be an int-returning function.


(Just going by CWRon's response when I asked why their main returns void.)

>
> Simmilarly for your other issues. The idea is people come here for
> instruction. Telling them to do non-standard things just because some
> compilers support it isn't productive.


I'm not advocating telling them to do the wrong thing, just not to
concentrate *so much* on those two items when responding to a post that's
about something else. And to respond in a kindler, gentler manner, not jump
on them for making a mistake that their IDE may actually have made for them.
That's all.

-Howard




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Couple of n00b questions - please help :) Hellraiser UK VOIP 17 03-20-2006 10:49 PM
ASP.NET n00b needs help here John McClamrock ASP .Net 1 02-03-2005 03:52 AM
n00b Help Setting up MSDE SQL Server newgenre ASP .Net 4 04-27-2004 04:13 PM
n00b Help with Beginning SQL for ASP.NET App newgenre ASP .Net 1 04-14-2004 06:03 PM
N00b 413Rt - need help Joseph Good Cisco 2 04-04-2004 05:11 PM



Advertisments