Yes, he asked why only the first got screwed up. This will screw all of them up.
Wouldn't that just bork all of the array instead of just the first double?
Well you are pointing to the first element in the array, then modifying only sizeof(double) bytes.
Any memory after sizeof(double) bytes should be unaffected.
To modify all,memset(ma,1,sizeof(double)*5);This has nothing to do with reinterpret_cast.
jnmacdMember Since 22 Sep 2010
Offline Last Active May 23 2013 11:25 AM
- Group Members
- Active Posts 27
- Profile Views 1,282
- Submitted Links 0
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown