linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: value computed is not used ??
@ 2004-06-01 17:34 Huber, George K RDECOM CERDEC STCD SRI
  2004-06-01 19:09 ` Glynn Clements
  0 siblings, 1 reply; 10+ messages in thread
From: Huber, George K RDECOM CERDEC STCD SRI @ 2004-06-01 17:34 UTC (permalink / raw)
  To: linux-c-programming



-----Original Message-----
From: linux-c-programming-owner@vger.kernel.org
[mailto:linux-c-programming-owner@vger.kernel.org]On Behalf Of Charlie
Gordon
Sent: Tuesday, June 01, 2004 12:09 PM
To: linux-c-programming@vger.kernel.org
Subject: Re: value computed is not used ??

Charlie wrote (qoting J.)

>> I understood everything in the above answer except for one issue ? Why
is:
>> int main(void) {
>> The wrong prototype for main ? main() schould return `0' or `1' etc ?!?
>> Thank you very much for taking the effort to explain and answer.
>> Jeroen.

>the proper prototype for main is
>int main(int argc, char **argv);
>or possibly :
>int main(int argc, char *argv[]);
>which is semantically equivalent, but emphasises the fact that argv points
>to an array of char*

I to am a little confused on why you state that int main(void) is an
incorrect 
prototype for main?  Quoting from the C99 - draft standard,

"The function called at program startup is named main.  The implementation
declares
no prototype for this function.  It shall be defined with a return type of
int and with
no parameters:
    int main(void) {/* ... */}
or with two parameters (referred to hear 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[]) {/* ... *.}
or equivalent, or in some other implementation-defined manner." (section
5.1.2.2.1)

This seems to imply that either prototype for main may be used.  Is this a
new 
addition to the C99 standard, or am I missing something here.

George





-
To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: functions to determine dementions of console?
@ 2004-05-31 19:38 Christoph Bussenius
  2004-06-01  1:41 ` value computed is not used ?? J.
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Bussenius @ 2004-05-31 19:38 UTC (permalink / raw)
  To: linux-c-programming

On Sun, May 30, 2004 at 11:35:18PM +0300, Micha Feigin wrote:
> Its usually done using the environment variables in COLUMNS, AFAIK. They
> appear after the first null of argv IIRC.

I believe this is only a bash feature.

Regards,
Christoph

-- 
``There's no dark side of the moon, really
Matter of fact, it's all dark''

--Pink Floyd

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-06-03  1:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-01 17:34 value computed is not used ?? Huber, George K RDECOM CERDEC STCD SRI
2004-06-01 19:09 ` Glynn Clements
2004-06-01 20:58   ` Charlie Gordon
2004-06-01 21:44     ` Glynn Clements
  -- strict thread matches above, loose matches on Subject: below --
2004-05-31 19:38 functions to determine dementions of console? Christoph Bussenius
2004-06-01  1:41 ` value computed is not used ?? J.
2004-06-01  3:25   ` Glynn Clements
2004-06-01  7:30   ` Charlie Gordon
2004-06-01 16:08     ` Charlie Gordon
2004-06-01 21:58     ` Glynn Clements
2004-06-03  1:26       ` Micha Feigin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).