Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How can i emulate sizeof()

Reply
Thread Tools

How can i emulate sizeof()

 
 
Richard Tobin
Guest
Posts: n/a
 
      05-12-2008
In article <g09ooa$om1$(E-Mail Removed)>,
Kenny McCormack <(E-Mail Removed)> wrote:

>I think (against the tide, I understand) that you should assume that a
>poster has a reason for posting (as he does).


Yes, but for most of these sizeof() questions the context seems most
likely to be "I can't do the questions on my C test".

-- Richard
--
:wq
 
Reply With Quote
 
 
 
 
Kenny McCormack
Guest
Posts: n/a
 
      05-12-2008
In article <g09qnr$16he$(E-Mail Removed)>,
Richard Tobin <(E-Mail Removed)> wrote:
>In article <g09ooa$om1$(E-Mail Removed)>,
>Kenny McCormack <(E-Mail Removed)> wrote:
>
>>I think (against the tide, I understand) that you should assume that a
>>poster has a reason for posting (as he does).

>
>Yes, but for most of these sizeof() questions the context seems most
>likely to be "I can't do the questions on my C test".
>
>-- Richard
>--
>:wq


"Passing the class" is probably an even more important - and more deserving
reason - than "I wanna get laid".

 
Reply With Quote
 
 
 
 
El-Hassan Wanas
Guest
Posts: n/a
 
      05-12-2008
On Apr 30, 8:26*pm, Kenneth Brody <(E-Mail Removed)> wrote:
> Eugeny Myunster wrote:
>
> > Hello all,
> > * * * * How can i emulate sizeof()
> > * * * * only for integers?

>
> I'd really love to know which instructors keep giving this assignment.
>
> Why do you want to "emulate sizeof", when sizeof exists just for this
> purpose?
>
> How about:
>
> * * #define MySizeof(x) sizeof(x)
>
> Now you can "emulate sizeof" by using "MySizeof(int)", for example.
>
> --
> +-------------------------+--------------------+-----------------------+
> | Kenneth J. Brody * * * *|www.hvcomputer.com| #include * * * * * * *|
> | kenbrody/at\spamcop.net |www.fptech.com* * | * *<std_disclaimer.h> |
> +-------------------------+--------------------+-----------------------+
> Don't e-mail me at: <(E-Mail Removed)>


I think it is a punishment for missing some homework or something. I
totally agree with the Macro approach. Ask your instructor, What is
the point of this assignment?, will I ever work on a project and try
to emulate this?
 
Reply With Quote
 
Kenneth Brody
Guest
Posts: n/a
 
      05-14-2008
Kenny McCormack wrote:
>
> In article <g09qnr$16he$(E-Mail Removed)>,
> Richard Tobin <(E-Mail Removed)> wrote:
> >In article <g09ooa$om1$(E-Mail Removed)>,
> >Kenny McCormack <(E-Mail Removed)> wrote:
> >
> >>I think (against the tide, I understand) that you should assume that a
> >>poster has a reason for posting (as he does).

> >
> >Yes, but for most of these sizeof() questions the context seems most
> >likely to be "I can't do the questions on my C test".

>
> "Passing the class" is probably an even more important - and more deserving
> reason - than "I wanna get laid".


Quandry:

Professor says "get the size of an object without using sizeof".

SO says "don't".

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <(E-Mail Removed)>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How can I emulate a mouse click event at a specific location yinglcs@gmail.com Javascript 6 11-11-2007 03:00 AM
Can ASP.NET emulate a Telnet host? Forty Two ASP .Net 2 12-25-2004 01:24 AM
Emulate PIX Firewall shaulbe Cisco 19 04-15-2004 06:54 PM
Re: Can we emulate a char buffer to a FILE* ? Malcolm C Programming 4 07-11-2003 02:38 PM



Advertisments