Re: passing a string to a C++ function



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.


.