Re: Help a beginner - function with pointer ...
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Tue, 14 Jul 2009 09:39:33 -0700
Ben Bacarisse <ben.usenet@xxxxxxxxx> writes:
"bpascal123@xxxxxxxxxxxxxx" <bpascal123@xxxxxxxxxxxxxx> writes:
Sorry for not following this post i have initiated. Here is the full
code so you can see where I was confused.
When i sent this post, i thought (float *) T would be appealing to
some C expert programmer like some inside c convention such as a
+=1 ... i didn't even try to compil the code before sending it to you
let say for validation ; my fault
#include <stdio.h>
main()
int main(void) is better. Leaving off the return type is not valid in
C99 (the latest standard) but // are a C99 feature so can't use // and
leave off the return type.
Well, you can, but you probably shouldn't.
You can't use // comments (a C99-only feature) and implicit int (a
C90-only feature) in the same program *if* you want the program to
conform to some C standard. But most C compilers, in their default
mode, accept both implicit int (to avoid breaking old code) and //
comments (either as an extension to C90 or as a feature of partially
implemented C99 support), so you can probably get away with it.
But that doesn't mean you should. By using a compiler in some
partially conforming mode, where it supports some arbitrary set of
extensions and some arbitrary set of C99 features, you can make it
more difficult to port the code to some other implementation with
a subtly different set of extensions and features, and you can lose
out on diagnostics that can tell you where your code is non-portable.
Anyway, it is always better to be explicit
even if you don't have to be.
Agreed.
Well, not always. For example, a cast is more explicit than an
implicit conversion, but it's usually better to depend on the
implicit conversion when it's available.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- Follow-Ups:
- Re: Help a beginner - function with pointer ...
- From: Richard Heathfield
- Re: Help a beginner - function with pointer ...
- References:
- Help a beginner - function with pointer ...
- From: bpascal123@xxxxxxxxxxxxxx
- Re: Help a beginner - function with pointer ...
- From: Nick Keighley
- Re: Help a beginner - function with pointer ...
- From: Keith Thompson
- Re: Help a beginner - function with pointer ...
- From: Eric Sosman
- Re: Help a beginner - function with pointer ...
- From: Keith Thompson
- [OT] Re: Help a beginner - function with pointer ...
- From: Eric Sosman
- Re: Help a beginner - function with pointer ...
- From: bpascal123@xxxxxxxxxxxxxx
- Re: Help a beginner - function with pointer ...
- From: Ben Bacarisse
- Help a beginner - function with pointer ...
- Prev by Date: Re: tutorials
- Next by Date: Re: tutorials
- Previous by thread: Re: Help a beginner - function with pointer ...
- Next by thread: Re: Help a beginner - function with pointer ...
- Index(es):
Relevant Pages
|