Re: A little help please

From: Rich (Someone_at_somewhere.com)
Date: 12/28/04


Date: Tue, 28 Dec 2004 12:36:34 +0000 (UTC)


> Did someone set you that as homework? Because if they did they should be
> shot. Changing the bit pattern of an int that way is a 'no no' as it
> results in undefined behaviour when you next access the value stored as
> an int.

Yes they did :) I have done most of the tasks, this was set as an
excercise to find out about void* and to do the question exactly as laid
out.

This question has had me stumped for a couple of days now.

I have read plenty about void* and as everyone else says there are
better ways to solve this unfortunately, if I use better ways I wont be
answering the question correctly.

char ch ='' was a typo I did mean char ch = ' '; honest :)

The only reason I set everything to some value is because by not doing
it has caused me headaches in the past with uninitialised values holding
junk and causing what seemed like unfindable bugs at first :)

The problem is I do not understand the question myself fully and do not
know exactly what I am supposed to be doing with this question.

I think I need to be doing the static_cast again in the function to cast
back to an int.

I am well and truly stuck!!



Relevant Pages

  • Help in Java swings(internal Frame)
    ... public int getSize() ... public void valueChanged{ ... private JScrollPane scrollPane1; ... public class PeakContainer extends JInternalFrame ...
    (comp.lang.java.programmer)
  • [PATCH] get rid if __cpuinit and __cpuexit
    ... unsigned long action, void *hcpu) ... unsigned int cpu = hcpu; ... -static int __cpuinit ... __cpu_up(unsigned int cpu) ...
    (Linux-Kernel)
  • [PATCH,RFC 2.6.14 09/15] KGDB: SuperH-specific changes
    ... This adds basic support for KGDB on SuperH as well as adding some architecture ... -static int kgdb_uart_getchar ... -static void kgdb_uart_putchar ... * The command-line option can include a serial port specification ...
    (Linux-Kernel)
  • problem in java swings
    ... public int getSize() ... public void valueChanged{ ... private JScrollPane scrollPane1; ... public class PeakContainer extends JInternalFrame ...
    (comp.lang.java.programmer)
  • ToolTips in a View and TTN_NEEDTEXT
    ... extern int g_minWorkPeriod; ... void CDayView::CreateAllFonts ... void CDayView::DrawDayLog(CDC* pDC) ... BOOL CDayView::TimeToY ...
    (microsoft.public.vc.mfc)