Re: Help a beginner - function with pointer ...



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"
.



Relevant Pages

  • Re: CERT C Secure Coding Standard - last call for reviewers
    ... The only feature really missing is the designator initializers ... I have implemented with my extensions the complex numbers ... part of C99, and using the generic functions feature I implemented ... So from a C99 P.O.V. your compiler still lacks complex support and ...
    (comp.lang.c)
  • Re: CERT C Secure Coding Standard - last call for reviewers
    ... The only feature really missing is the designator initializers ... I have implemented with my extensions the complex numbers ... I seem to recall that for operator overloading you use a syntax that in standard compliant mode requires a diagnostic. ...
    (comp.lang.c)
  • Re: how do i get rid of subsites
    ... If your host does nothave the extensions the publish feature ... > I imported a site as a subsite. ...
    (microsoft.public.frontpage.client)
  • Re: arrange by type in windows xp
    ... I had always thought that this feature simply arranged ... > files by alphabetizing them by their extensions, ... > isn't found by scanning extensions for P, it is found by scanning the ...
    (microsoft.public.windowsxp.customize)