PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > sizeof size_t
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
sizeof size_t

Réponse
 
LinkBack Outils de la discussion
Vieux 03/02/2008, 02h04   #1
Bill Cunningham
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut sizeof size_t

I would like to check the sizeof size_t. Anyone have a suggestion?

Bill


  Réponse avec citation
Vieux 03/02/2008, 02h07   #2
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sizeof size_t

Bill Cunningham wrote:
> I would like to check the sizeof size_t. Anyone have a suggestion?
>

sizeof(size_t)?

--
Ian Collins.
  Réponse avec citation
Vieux 03/02/2008, 02h20   #3
MisterE
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sizeof size_t


"Bill Cunningham" <nospam@nspam.com> wrote in message
news:bj9pj.6165$qI.2153@trnddc03...
> I would like to check the sizeof size_t. Anyone have a suggestion?


its a typedef so why can't you just do sizeof(size-t)


  Réponse avec citation
Vieux 03/02/2008, 02h29   #4
Bill Cunningham
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sizeof size_t


"Ian Collins" <ian-news@hotmail.com> wrote in message
news:60klvjF1qsb4fU18@mid.individual.net...
> Bill Cunningham wrote:
>> I would like to check the sizeof size_t. Anyone have a suggestion?
>>

> sizeof(size_t)?
>

It would have to be that obvious ok thanks.

Bill


  Réponse avec citation
Vieux 03/02/2008, 03h05   #5
Martin Ambuhl
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sizeof size_t

Bill Cunningham wrote:
> I would like to check the sizeof size_t. Anyone have a suggestion?


You may kick yourself when you see how trivial this is:

#include <stdio.h>

int main(void)
{
printf("[Output]\n"
"For this implementation, sizeof(size_t) is %zu\n",
sizeof(size_t));
return 0;
}

[Output]
For this implementation, sizeof(size_t) is 4

  Réponse avec citation
Vieux 03/02/2008, 03h06   #6
Martin Ambuhl
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sizeof size_t

MisterE wrote:
> "Bill Cunningham" <nospam@nspam.com> wrote in message
> news:bj9pj.6165$qI.2153@trnddc03...
>> I would like to check the sizeof size_t. Anyone have a suggestion?

>
> its a typedef so why can't you just do sizeof(size-t)


unless the variable 'size' and 't' are declared, the type of their
difference is not very well defined, is it?
  Réponse avec citation
Vieux 03/02/2008, 03h23   #7
frog
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sizeof size_t

On 2ÔÂ3ÈÕ, ÉÏÎç10ʱ29·Ö, "Bill Cunningham" <nos...@nspam.com> wrote:
> "Ian Collins" <ian-n...@hotmail.com> wrote in message
>
> news:60klvjF1qsb4fU18@mid.individual.net...> Bill Cunningham wrote:
> >> I would like to check the sizeof size_t. Anyone have a suggestion?

>
> > sizeof(size_t)?

>
> It would have to be that obvious ok thanks.
>
> Bill


  Réponse avec citation
Vieux 03/02/2008, 03h23   #8
vippstar@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sizeof size_t

On Feb 3, 5:06 am, Martin Ambuhl <mamb...@earthlink.net> wrote:
> MisterE wrote:
> > "Bill Cunningham" <nos...@nspam.com> wrote in message
> >news:bj9pj.6165$qI.2153@trnddc03...
> >> I would like to check the sizeof size_t. Anyone have a suggestion?

>
> > its a typedef so why can't you just do sizeof(size-t)

>
> unless the variable 'size' and 't' are declared, the type of their
> difference is not very well defined, is it?


Is it not?
#define size 42
#define t 6
As far as I know, 'size' and 't' in my example are not variables.
  Réponse avec citation
Vieux 03/02/2008, 04h59   #9
CBFalconer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sizeof size_t

Bill Cunningham wrote:
>
> I would like to check the sizeof size_t. Anyone have a suggestion?


size_t is a type. Therefore sizof needs it in parenthesis.

n = sizeof (size_t);

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h43.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12893 seconds with 17 queries