Re: Another Understanding Pointers Question
From: Leor Zolman (leor_at_bdsoft.com)
Date: 05/11/04
- Next message: Kieran Simkin: "Re: Function to remove an item from a linked list failing ~1 out of 10,000 times"
- Previous message: Wendy E. McCaughrin: "Re: new to C, how do I solve this problem?"
- In reply to: Materialised: "Re: Another Understanding Pointers Question"
- Next in thread: Materialised: "Re: Another Understanding Pointers Question"
- Reply: Materialised: "Re: Another Understanding Pointers Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 11 May 2004 01:34:55 GMT
On Tue, 11 May 2004 01:56:17 +0100, Materialised <Materialised@privacy.net>
wrote:
>I have taken all the people who replied comments to heart, and I am glad
>for your feadback.
>What I dont understand is what is wrong with sizeof(char)? True char may
>be defined as 1 on most architectures. But does the way I have
>referenced it require extra CPU useage or something?
>
>Sorry if thats a dumb question..
Not dumb at all. The Standard spells it out as follows (6.5.3.4/3):
"When applied to an operand that has type char, unsigned char, or signed
char, (or a qualified version thereof) the result is 1."
So sizeof(char) is 1, period. Which makes writing it out a bit redundant,
that's all.
-leor
-- Leor Zolman --- BD Software --- www.bdsoft.com On-Site Training in C/C++, Java, Perl and Unix C++ users: download BD Software's free STL Error Message Decryptor at: www.bdsoft.com/tools/stlfilt.html
- Next message: Kieran Simkin: "Re: Function to remove an item from a linked list failing ~1 out of 10,000 times"
- Previous message: Wendy E. McCaughrin: "Re: new to C, how do I solve this problem?"
- In reply to: Materialised: "Re: Another Understanding Pointers Question"
- Next in thread: Materialised: "Re: Another Understanding Pointers Question"
- Reply: Materialised: "Re: Another Understanding Pointers Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|