Re: passing a string to a C++ function
- From: "Tom Serface" <tserface@xxxxxxx>
- Date: Thu, 13 Oct 2005 10:01:37 -0700
Hi Igor,
I disagree. When I used to write in "C" I used this form all the time and
it seemed to make perfect sense (before prototypes). When you write it this
way you can do things like:
int f(x,y)
int x; /* first input value */
int y; /* second input value */
{
return (x+y);
}
Like so many things in the religion of programming there are lots of ways to
do the same thing and lots of reasons to use the ways.
Tom
"Igor Tandetnik" <itandetnik@xxxxxxxx> wrote in message
news:%23tIMM24zFHA.1132@xxxxxxxxxxxxxxxxxxxxxxx
> "Lawrence Groves" <lgroves@xxxxxxxxxxxxxxxxx> wrote in message
> news:OSKlWAzzFHA.3660@xxxxxxxxxxxxxxxxxxxx
>> "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx> wrote in message
>> news:uk9PrpOzFHA.2960@xxxxxxxxxxxxxxxxxxxxxxx
>>> Unfortunately, K&R style is in general horrible. There is nothing
>>> wrong with this particular line, but you should not take their code
>>> as example.
>>
>> I don't agree. Before C++ came along it was the defacto standard. How
>> can you say they have bad style or are no good for examples? They
>> invented the language so who better to follow?
>
> The original K&R style looks like this:
>
> int f(x, y)
> int x;
> int y;
> {
> return x + y;
> }
>
> Nobody in their right mind, including C programmers, writes code like that
> nowadays. This style was considered horrible well before C++ was invented.
.
- Follow-Ups:
- Re: passing a string to a C++ function
- From: William DePalo [MVP VC++]
- Re: passing a string to a C++ function
- From: Doug Harrison [MVP]
- Re: passing a string to a C++ function
- References:
- passing a string to a C++ function
- From: Leo
- Re: passing a string to a C++ function
- From: Victor Bazarov
- Re: passing a string to a C++ function
- From: Leo
- Re: passing a string to a C++ function
- From: David Webber
- Re: passing a string to a C++ function
- From: Leo
- Re: passing a string to a C++ function
- From: David Webber
- Re: passing a string to a C++ function
- From: Leo
- Re: passing a string to a C++ function
- From: Brian Muth
- Re: passing a string to a C++ function
- From: Lawrence Groves
- Re: passing a string to a C++ function
- From: Tom Serface
- Re: passing a string to a C++ function
- From: Lawrence Groves
- Re: passing a string to a C++ function
- From: Alexander Grigoriev
- Re: passing a string to a C++ function
- From: Lawrence Groves
- Re: passing a string to a C++ function
- From: Igor Tandetnik
- passing a string to a C++ function
- Prev by Date: Re: Fastest way to write in a file
- Next by Date: Re: passing a string to a C++ function
- Previous by thread: Re: passing a string to a C++ function
- Next by thread: Re: passing a string to a C++ function
- Index(es):
Relevant Pages
|