[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c

sizeof

io_x

6/27/2011 7:49:00 AM

is ok to write
#include <stdio.h>

int main(void)
{
size_t a=sizeof 1.1;
return 0;
}

is size_t defined in stdio.h?
i say that because fread() here has one
size_t arg...

is (sizeof 1.1)==sizeof(double)?
Thank you


3 Answers

Barry Schwarz

6/27/2011 1:05:00 PM

0

On Mon, 27 Jun 2011 09:48:41 +0200, "io_x" <a@b.c.invalid> wrote:

>is ok to write
>#include <stdio.h>
>
>int main(void)
>{
> size_t a=sizeof 1.1;
> return 0;
>}

Yes.

>
>is size_t defined in stdio.h?

Yes.

>i say that because fread() here has one
>size_t arg...
>
>is (sizeof 1.1)==sizeof(double)?

Yes.

--
Remove del for email

Shao Miller

6/27/2011 4:06:00 PM

0

On 6/27/2011 03:48, io_x wrote:
> is ok to write
> #include<stdio.h>
>
> int main(void)
> {
> size_t a=sizeof 1.1;
> return 0;
> }
>
> is size_t defined in stdio.h?
> i say that because fread() here has one
> size_t arg...
>
> is (sizeof 1.1)==sizeof(double)?
> Thank you
>
>

Why not download a Standard? It's so easy:

http://www.open-std.org/jtc1/sc22/wg14/www/docs...

Then look at 7.19.1p2.

Bill Cunningham

6/29/2011 3:53:00 AM

0

Shao Miller wrote:

> Why not download a Standard? It's so easy:
>
> http://www.open-std.org/jtc1/sc22/wg14/www/docs...

Ok thanks I'll take a copy of that.

Bill