Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Microsoft's so called programmers (ROTFL! :-)

Reply
Thread Tools

Microsoft's so called programmers (ROTFL! :-)

 
 
Adem24
Guest
Posts: n/a
 
      06-19-2008
Microsoft's so called programmers write braindamaged programs
and confusing buggy examples and help pages like that below.
It is even from the online "help" (ROTFL! of their "compiler" (ROTFL! :


<CITATION_FROM_THE_MSDN_LIBRARY>

/* FMOD.C: This program displays a
* floating-point remainder.
*/

#include <math.h>
#include <stdio.h>

void main( void )
{
double w = -10.0, x = 3.0, y = 0.0, z;

z = fmod( x, y );
printf( "The remainder of %.2f / %.2f is %f\n", w, x, z );
printf( "The remainder of %.2f / %.2f is %f\n", x, y, z );

}

Output

The remainder of -10.00 / 3.00 is -1.000000

</CITATION_FROM_THE_MSDN_LIBRARY>


ROTFL! ))
ROTFL! ))
ROTFL! ))

 
Reply With Quote
 
 
 
 
acehreli@gmail.com
Guest
Posts: n/a
 
      06-19-2008
On Jun 19, 12:03 pm, "Adem24" <ade...@nospammplease.org.invalid>
wrote:
> Microsoft's so called programmers write braindamaged programs
> and confusing buggy examples and help pages like that below.
> It is even from the online "help" (ROTFL! of their "compiler" (ROTFL! :
>
> <CITATION_FROM_THE_MSDN_LIBRARY>
>
> /* FMOD.C: This program displays a
> * floating-point remainder.
> */
>
> #include <math.h>
> #include <stdio.h>
>
> void main( void )
> {
> double w = -10.0, x = 3.0, y = 0.0, z;
>
> z = fmod( x, y );
> printf( "The remainder of %.2f / %.2f is %f\n", w, x, z );
> printf( "The remainder of %.2f / %.2f is %f\n", x, y, z );
>
> }
>
> Output
>
> The remainder of -10.00 / 3.00 is -1.000000
>
> </CITATION_FROM_THE_MSDN_LIBRARY>
>
> ROTFL! ))
> ROTFL! ))
> ROTFL! ))


No, 'void main' was not always illegal; the early C specification did
not spell out what main's return type would be.

Now, would you please provide an on-topic comment? Are you referring
to the fact that one of the code lines appear to be duplicated? Does
that not match some of the mistakes you make in your programs?

Just to let you know, most programmers at most companies write brain-
damaged code once in a while. You spot one because they exposed one...

Ali
 
Reply With Quote
 
 
 
 
Bill Gates
Guest
Posts: n/a
 
      06-19-2008
Am 19.06.2008, 21:03 Uhr, schrieb Adem24
<>:

> Microsoft's so called programmers write braindamaged programs
> and confusing buggy examples and help pages like that below.
> It is even from the online "help" (ROTFL! of their "compiler"
> (ROTFL! :
>
>
> <CITATION_FROM_THE_MSDN_LIBRARY>
>
> /* FMOD.C: This program displays a
> * floating-point remainder.
> */
>
> #include <math.h>
> #include <stdio.h>
>
> void main( void )
> {
> double w = -10.0, x = 3.0, y = 0.0, z;
>
> z = fmod( x, y );
> printf( "The remainder of %.2f / %.2f is %f\n", w, x, z );
> printf( "The remainder of %.2f / %.2f is %f\n", x, y, z );
>
> }
>
> Output
>
> The remainder of -10.00 / 3.00 is -1.000000
>
> </CITATION_FROM_THE_MSDN_LIBRARY>
>
>
> ROTFL! ))
> ROTFL! ))
> ROTFL! ))
>


AT MOMENT I AM IN EUROPE BUT I WILL FIND YOU! YOU SNOBISH SUN OF A PIG!!

IN HATE;
WILLIAM "BILL" GATES

oh; please copy and paste the virus below and compile cause i cant.


--
internet = converttostring(hole_internet)
while(internet != null)
if (internet.token == "Linux") internet.token.replaceTo("Microsoft");
 
Reply With Quote
 
Kai-Uwe Bux
Guest
Posts: n/a
 
      06-19-2008
wrote:

> On Jun 19, 12:03 pm, "Adem24" <ade...@nospammplease.org.invalid>
> wrote:
>> Microsoft's so called programmers write braindamaged programs
>> and confusing buggy examples and help pages like that below.
>> It is even from the online "help" (ROTFL! of their "compiler" (ROTFL!
>> :
>>
>> <CITATION_FROM_THE_MSDN_LIBRARY>
>>
>> /* FMOD.C: This program displays a
>> * floating-point remainder.
>> */
>>
>> #include <math.h>
>> #include <stdio.h>
>>
>> void main( void )
>> {
>> double w = -10.0, x = 3.0, y = 0.0, z;
>>
>> z = fmod( x, y );
>> printf( "The remainder of %.2f / %.2f is %f\n", w, x, z );
>> printf( "The remainder of %.2f / %.2f is %f\n", x, y, z );
>>
>> }
>>
>> Output
>>
>> The remainder of -10.00 / 3.00 is -1.000000
>>
>> </CITATION_FROM_THE_MSDN_LIBRARY>
>>
>> ROTFL! ))
>> ROTFL! ))
>> ROTFL! ))

>
> No, 'void main' was not always illegal;


It sure is illegal now (and there is no reason to advertise it in a code
snippet).

> the early C specification did not spell out what main's return type would
> be.
>
> Now, would you please provide an on-topic comment? Are you referring
> to the fact that one of the code lines appear to be duplicated?


Thee is no duplicated line.

It is interesting, though, that w does not enter the computation of z.

Also, taking a number mod 0.0 doesn't make sense.


Had they actually compiled the program and run it, they should have
discovered that the output is not as advertised (well, I guess, formally
anything could happen). I get:

The remainder of -10.00 / 3.00 is nan
The remainder of 3.00 / 0.00 is nan


[snip]


Best

Kai-Uwe Bux
 
Reply With Quote
 
Duane Hebert
Guest
Posts: n/a
 
      06-19-2008
> No, 'void main' was not always illegal; the early C specification did
> not spell out what main's return type would be.


Which one of the groups that this was cross posted to
talk about C?
 
Reply With Quote
 
Mirco Wahab
Guest
Posts: n/a
 
      06-19-2008
Adem24 wrote:
> Microsoft's so called programmers write braindamaged programs
> and confusing buggy examples and help pages like that below.
> It is even from the online "help" (ROTFL! of their "compiler" (ROTFL! :
> <CITATION_FROM_THE_MSDN_LIBRARY>
>
> /* FMOD.C: This program displays a
> * floating-point remainder.
> */
>
> #include <math.h>
> #include <stdio.h>
>
> void main( void )
> {
> double w = -10.0, x = 3.0, y = 0.0, z;
>
> z = fmod( x, y );
> printf( "The remainder of %.2f / %.2f is %f\n", w, x, z );
> printf( "The remainder of %.2f / %.2f is %f\n", x, y, z );
>
> }
>
> Output
>
> The remainder of -10.00 / 3.00 is -1.000000
>
> </CITATION_FROM_THE_MSDN_LIBRARY>


http://msdn.microsoft.com/en-us/libr...eh(VS.71).aspx

Regards

M.

f'up comp.lang.c++
 
Reply With Quote
 
Vyacheslav Kononenko
Guest
Posts: n/a
 
      06-19-2008
On Jun 19, 5:09*pm, Mirco Wahab <wahab-m...@gmx.de> wrote:
> Adem24 wrote:
> > Microsoft's so called programmers write braindamaged programs
> > and confusing buggy examples and help pages like that below.
> > It is even from the online "help" (ROTFL! of their "compiler" (ROTFL! :
> > <CITATION_FROM_THE_MSDN_LIBRARY>

>
> > /* FMOD.C: This program displays a
> > ** floating-point remainder.
> > **/

>
> > #include <math.h>
> > #include <stdio.h>

>
> > void main( void )
> > {
> > * *double w = -10.0, x = 3.0, y = 0.0, z;

>
> > * *z = fmod( x, y );
> > * *printf( "The remainder of %.2f / %.2f is %f\n", w, x, z );
> > * *printf( "The remainder of %.2f / %.2f is %f\n", x, y, z );

>
> > }

>
> > Output

>
> > The remainder of -10.00 / 3.00 is -1.000000

>
> > </CITATION_FROM_THE_MSDN_LIBRARY>

>
> http://msdn.microsoft.com/en-us/libr...eh(VS.71).aspx
>


They fixed it in .NET !!!

http://msdn.microsoft.com/en-us/library/ms859630.aspx


 
Reply With Quote
 
Greg Herlihy
Guest
Posts: n/a
 
      06-20-2008
On Jun 19, 3:08*pm, Vyacheslav Kononenko
<vyacheslav.konone...@gmail.com> wrote:
> On Jun 19, 5:09*pm, Mirco Wahab <wahab-m...@gmx.de> wrote:


> > Adem24 wrote:
> > > Microsoft's so called programmers write braindamaged programs
> > > and confusing buggy examples and help pages like that below.
> > > It is even from the online "help" (ROTFL! of their "compiler" (ROTFL! :
> > > <CITATION_FROM_THE_MSDN_LIBRARY>

>
> > > /* FMOD.C: This program displays a
> > > ** floating-point remainder.
> > > **/

>
> > > #include <math.h>
> > > #include <stdio.h>

>
> > > void main( void )
> > > {
> > > * *double w = -10.0, x = 3.0, y = 0.0, z;

>
> > > * *z = fmod( x, y );
> > > * *printf( "The remainder of %.2f / %.2f is %f\n", w, x, z );
> > > * *printf( "The remainder of %.2f / %.2f is %f\n", x, y, z );

>
> > > }

>
> > > Output

>
> > > The remainder of -10.00 / 3.00 is -1.000000

>
> > > </CITATION_FROM_THE_MSDN_LIBRARY>

>
> >http://msdn.microsoft.com/en-us/libr...eh(VS.71).aspx

>
> They fixed it in .NET !!!


... which means that the problem cited in the Visual Studio 7.1
documentation was fixed at least four years ago (for Visual C++ .NET)
and in fact remains correct in the documentation for their current C++
compiler (Visual C++ 200:

// crt_fmod.c
// This program displays a floating-point remainder.

#include <math.h>
#include <stdio.h>

int main( void )
{
double w = -10.0, x = 3.0, z;

z = fmod( w, x );
printf( "The remainder of %.2f / %.2f is %f\n", w, x, z );
}

Output:

The remainder of -10.00 / 3.00 is -1.000000

Greg

 
Reply With Quote
 
James Kanze
Guest
Posts: n/a
 
      06-20-2008
On Jun 20, 5:06 am, Jack Klein <jackkl...@spamcop.net> wrote:
> On Thu, 19 Jun 2008 12:42:00 -0700 (PDT), acehr...@gmail.com
> wrote in comp.lang.c++:


> [snip]


> > No, 'void main' was not always illegal; the early C
> > specification did not spell out what main's return type
> > would be.


> You are quite wrong about that. The earliest C specification
> was K&R, and it used implicit int as the return type for
> main(). And "void main()" was illegal at the time, BECAUSE
> THE KEYWORD 'void' DID NOT EXIST IN THE C LANGUAGE AT THE
> TIME. (sorry for shouting).




> The keyword 'void' was added to the C language by the original
> 1989/1990 ANSI and ISO standards.


The keyword void was added to the C language sometime before the
ANSI and the ISO standard was adopted.

> These are the same standards that clearly stated:


> "The function called at program startup is named main. The
> implementation declares no prototype for this function. It can be
> defined with no parameters


> int main(void) { /*...*/ }


> or with two parameters (referred to here as argc and argv, though any
> names may be used, as they are local to the function in which they are
> declared)


> int main(int argc, char *argv[]) { /*... */ }"


> So, yes, void main() has always been invalid C.


Unportable. The C standard makes it clear that there can be
other definitions of main as well; C99 makes it absolutely clear
that an implementation is allowed to accept void as well. It
wasn't really clear in C90, and the C++ standard clarified it in
the opposite direction, requiring a diagnostic if the return
type isn't int.

> On the other hand, compiler vendors are allowed to add any
> extensions they wish to their compilers, as long as those
> extensions don't change the meaning of a conforming program.


And that they diagnose all errors which require a diagnostic.

> Since void main() produces undefined behavior, a program that
> uses it is not conforming, allowing a compiler to accept it as
> a non-standard extension.


In this case, the C standard explicitly states that an
implementation can provide additional forms.

Historically, of course, all of the Unix implementations of C
(and they were the first) accepted a form with three parameters
as well, so the C standard wasn't innovating in allowing this.

--
James Kanze (GABI Software) email:
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
 
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
Is the average IQ of C programmers less than that of C++ programmers? MikeP C Programming 40 04-07-2011 10:19 PM
Re: Is the average IQ of C programmers less than that of C++ programmers? bert C Programming 1 04-06-2011 09:46 PM
Maybe C is the perfect language for really good systems programmers, but unfortunately not-so-good systems and applications programmers are using it and they shouldn’t be. Casey Hawthorne C Programming 18 11-06-2009 05:05 AM
C programmers have a phobia of Java/C++ programmers broli C Programming 3 04-03-2008 12:08 PM
three times copy ctor called, one ctor called, why? Apricot C++ 4 04-16-2004 07:55 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57