www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/23/22:53:42

Xref: news-dnh.mv.net comp.os.msdos.djgpp:549
Path: news-dnh.mv.net!mv!news.sprintlink.net!howland.reston.ans.net!spool.mu.edu!agate!albert.ssl.berkeley.edu!korpela
From: korpela AT albert DOT ssl DOT berkeley DOT edu (Eric J. Korpela)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: c++ comments
Date: 23 Jun 1995 21:28:08 GMT
Organization: Cal Berkeley-- Space Sciences Lab
Lines: 30
References: <Pine DOT SUN DOT 3 DOT 91 DOT 950623085435 DOT 2031A-100000 AT physics DOT ubc DOT ca> <803925756snz AT chocolat DOT demon DOT co DOT uk> <3sf3dn$4i6 AT odin DOT diku DOT dk>
Nntp-Posting-Host: albert.ssl.berkeley.edu
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

In article <3sf3dn$4i6 AT odin DOT diku DOT dk>, Morten Welinder <terra AT diku DOT dk> wrote:
>void
>main ()
>{
>  printf ("%d\n", 10 //* 
>                  2 // 1 */
>         );
>}
>
>This program should print 10, not 5.

Or even better the compiler should print...

t1.c: In function `main':
t1.c:4: warning: implicit declaration of function `printf'
t1.c:6: parse error before `)'

:)

I do agree with your point, though.  The C++ comment convention
should be used for C++.  After all, it's a different language.

Even though the compiler can understand both [C and C++], one shouldn't
mix the two in the same file.  You don't see anyone trying to put
Fortran comments in their C code.

-- 
Eric Korpela                        |  A day without meetings is like
korpela AT ssl DOT berkeley DOT edu            |  work.
<a href="http://www.cs.indiana.edu/finger/mofo.ssl.berkeley.edu/korpela/w">Click here for more info.</a>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019