Re: A little help please
From: Rich (Someone_at_somewhere.com)
Date: 12/28/04
- Next message: Rich: "Re: A little help please"
- Previous message: Chris \( Val \): "Re: [C++] Inheritance Question: Constructors for Derived classes?"
- In reply to: Francis Glassborow: "Re: A little help please"
- Next in thread: Chris \( Val \): "Re: A little help please"
- Reply: Chris \( Val \): "Re: A little help please"
- Reply: Alwyn: "Re: A little help please"
- Reply: Francis Glassborow: "Re: A little help please"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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!!
- Next message: Rich: "Re: A little help please"
- Previous message: Chris \( Val \): "Re: [C++] Inheritance Question: Constructors for Derived classes?"
- In reply to: Francis Glassborow: "Re: A little help please"
- Next in thread: Chris \( Val \): "Re: A little help please"
- Reply: Chris \( Val \): "Re: A little help please"
- Reply: Alwyn: "Re: A little help please"
- Reply: Francis Glassborow: "Re: A little help please"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|