Click here to Skip to main content
15,892,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioncreate thread in asm block Pin
zon_cpp14-Jan-07 20:06
zon_cpp14-Jan-07 20:06 
AnswerRe: create thread in asm block Pin
yeti1114-Jan-07 20:13
yeti1114-Jan-07 20:13 
GeneralRe: create thread in asm block Pin
zon_cpp15-Jan-07 18:27
zon_cpp15-Jan-07 18:27 
GeneralRe: create thread in asm block Pin
yeti1115-Jan-07 21:48
yeti1115-Jan-07 21:48 
Questioncasting stl::vector confusion... Pin
yeti1114-Jan-07 19:59
yeti1114-Jan-07 19:59 
AnswerRe: casting stl::vector confusion... Pin
Stephen Hewitt14-Jan-07 20:24
Stephen Hewitt14-Jan-07 20:24 
GeneralRe: casting stl::vector confusion... [modified] Pin
yeti1114-Jan-07 21:03
yeti1114-Jan-07 21:03 
AnswerRe: casting stl::vector confusion... Pin
El Corazon14-Jan-07 20:46
El Corazon14-Jan-07 20:46 
yeti11 wrote:
I have been thinking about; if i have pointer stored inside vector, at the end it
is stored as address to something and the address is the same size in any case. So
if i cast it, there should be no changes, but i still got a core dump (it works for
instance in 20 cases, but then one crashes).


I am not sure what you are trying to accomplish, but if a vector is auto-expanding, any pointers would no longer relate to the current location in memory. This is one reason why pointers are discouraged with STL, and even iterators have to be used cautiously. Both an advantage and disadvantage, STL automatically allocates, and reallocates memory to extend itself.

The iterators/pointers will be valid only as long as the size of the vector remains the same, when you add to the vector, depending on its current size, it could expand to fit the new information, and change memory location.

http://groups.google.com/group/comp.lang.c++/browse_thread/thread/d6fa8209e754aab9/11c794375a7bd8a3%2311c794375a7bd8a3[^]

_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

GeneralRe: casting stl::vector confusion... [modified] Pin
yeti1114-Jan-07 21:05
yeti1114-Jan-07 21:05 
AnswerRe: casting stl::vector confusion... Pin
Michael Dunn14-Jan-07 22:17
sitebuilderMichael Dunn14-Jan-07 22:17 
GeneralRe: casting stl::vector confusion... [modified] Pin
yeti1114-Jan-07 22:59
yeti1114-Jan-07 22:59 
GeneralRe: casting stl::vector confusion... Pin
El Corazon15-Jan-07 4:59
El Corazon15-Jan-07 4:59 
GeneralRe: casting stl::vector confusion... Pin
yeti1115-Jan-07 11:57
yeti1115-Jan-07 11:57 
GeneralRe: casting stl::vector confusion... Pin
El Corazon15-Jan-07 15:00
El Corazon15-Jan-07 15:00 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 12:37
Stephen Hewitt15-Jan-07 12:37 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 12:02
Stephen Hewitt15-Jan-07 12:02 
GeneralRe: casting stl::vector confusion... Pin
yeti1115-Jan-07 12:16
yeti1115-Jan-07 12:16 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 16:00
Stephen Hewitt15-Jan-07 16:00 
GeneralRe: casting stl::vector confusion... [modified] Pin
yeti1115-Jan-07 18:21
yeti1115-Jan-07 18:21 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 18:27
Stephen Hewitt15-Jan-07 18:27 
GeneralRe: casting stl::vector confusion... Pin
yeti1115-Jan-07 18:39
yeti1115-Jan-07 18:39 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 18:43
Stephen Hewitt15-Jan-07 18:43 
GeneralRe: casting stl::vector confusion... Pin
yeti1115-Jan-07 18:44
yeti1115-Jan-07 18:44 
AnswerRe: casting stl::vector confusion... Pin
John R. Shaw15-Jan-07 4:18
John R. Shaw15-Jan-07 4:18 
GeneralRe: casting stl::vector confusion... Pin
yeti1115-Jan-07 12:09
yeti1115-Jan-07 12:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.