Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #99683

Re: [File Handling] fread(), fseek() and text file

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: [File Handling] fread(), fseek() and text file
Date 2016-12-16 20:16 +0000
Organization A noiseless patient Spider
Message-ID <8737hn1vg3.fsf@bsb.me.uk> (permalink)
References (7 earlier) <o316fv$dr5$1@dont-email.me> <f2a424b3-1a56-4c49-b792-ed9fcd9969e9@googlegroups.com> <o318om$m6s$1@dont-email.me> <bb0da670-4df4-4db4-a023-bac9f68b039d@googlegroups.com> <o31cc7$4gs$1@dont-email.me>

Show all headers | View raw


Richard Heathfield <rjh@cpax.org.uk> writes:

> On 16/12/16 18:03, Dexterr wrote:
>> 	// Memory allocation for struct Components
>> 	Components *series_connection = (Components*) malloc(sizeof
>> *series_connection);
>
> For the last time: you don't need the cast.
>
> Components *series_connection = malloc(sizeof *series_connection);
>
> (If you can't learn, I can't teach you.)

It's possible the OP has been told to use a cast, or, at least it's been
there in examples in class or in the course materials.  Would you rather
do it the way the person marking your paper does it, or the way someone
on Usenet told you to do it? :-)

<snip>
-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-16 01:10 -0800
  Re: [File Handling] fread(), fseek() and text file Richard Heathfield <rjh@cpax.org.uk> - 2016-12-16 09:59 +0000
    Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-16 05:28 -0800
      Re: [File Handling] fread(), fseek() and text file Richard Heathfield <rjh@cpax.org.uk> - 2016-12-16 14:02 +0000
        Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-16 06:30 -0800
          Re: [File Handling] fread(), fseek() and text file Richard Heathfield <rjh@cpax.org.uk> - 2016-12-16 15:20 +0000
            Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-16 08:54 -0800
              Re: [File Handling] fread(), fseek() and text file Richard Heathfield <rjh@cpax.org.uk> - 2016-12-16 17:00 +0000
                Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-16 09:32 -0800
                Re: [File Handling] fread(), fseek() and text file Richard Heathfield <rjh@cpax.org.uk> - 2016-12-16 17:38 +0000
                Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-16 10:03 -0800
                Re: [File Handling] fread(), fseek() and text file Richard Heathfield <rjh@cpax.org.uk> - 2016-12-16 18:40 +0000
                Re: [File Handling] fread(), fseek() and text file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-12-16 20:16 +0000
                Re: [File Handling] fread(), fseek() and text file Keith Thompson <kst-u@mib.org> - 2016-12-16 12:46 -0800
                Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-17 05:47 -0800
                Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-17 05:49 -0800
                Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-17 05:43 -0800
                Re: [File Handling] fread(), fseek() and text file Barry Schwarz <schwarzb@dqel.com> - 2016-12-17 08:48 -0800
                Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-17 12:03 -0800
                Re: [File Handling] fread(), fseek() and text file Keith Thompson <kst-u@mib.org> - 2016-12-17 12:22 -0800
                Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-17 12:23 -0800
  Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-17 12:26 -0800
    Re: [File Handling] fread(), fseek() and text file asetofsymbols@gmail.com - 2016-12-18 12:41 -0800
      Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-18 13:04 -0800
      Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-18 13:08 -0800
        Re: [File Handling] fread(), fseek() and text file asetofsymbols@gmail.com - 2016-12-19 06:14 -0800
          Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-19 10:38 -0800
            Re: [File Handling] fread(), fseek() and text file Richard Heathfield <rjh@cpax.org.uk> - 2016-12-19 18:51 +0000
              Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-19 11:14 -0800
                Re: [File Handling] fread(), fseek() and text file Richard Heathfield <rjh@cpax.org.uk> - 2016-12-19 19:35 +0000
          Re: [File Handling] fread(), fseek() and text file Dexterr <dejangru@gmail.com> - 2016-12-19 10:43 -0800

csiph-web