Click here to Skip to main content
15,915,771 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Posix Thread Question Pin
tiberiuv12-Aug-08 21:08
tiberiuv12-Aug-08 21:08 
GeneralRe: Posix Thread Question Pin
Roger Stoltz12-Aug-08 22:33
Roger Stoltz12-Aug-08 22:33 
GeneralRe: Posix Thread Question Pin
tiberiuv13-Aug-08 1:48
tiberiuv13-Aug-08 1:48 
GeneralRe: Posix Thread Question Pin
tiberiuv14-Aug-08 2:16
tiberiuv14-Aug-08 2:16 
GeneralRe: Posix Thread Question Pin
Roger Stoltz14-Aug-08 2:35
Roger Stoltz14-Aug-08 2:35 
GeneralRe: Posix Thread Question Pin
tiberiuv14-Aug-08 3:26
tiberiuv14-Aug-08 3:26 
GeneralRe: Posix Thread Question Pin
Roger Stoltz14-Aug-08 3:33
Roger Stoltz14-Aug-08 3:33 
QuestionMemory allocation Pin
Dennis L12-Aug-08 4:15
Dennis L12-Aug-08 4:15 
Hi every one!

Can any one explain me why is this happening


struct SOME
{
char s0[1];
char s1[2];
char s2[1];
};

int main()
{
SOME *sm = new SOME;
delete sm;
return 0;
}


before allocation (with new)

0xcccccccc
{
s0=0xcccccccc <bad ptr="">
s1=0xcccccccd <bad ptr="">
s2=0xcccccccf <bad ptr="">
}

after allocation

0x00332e98
{
s0=0x00332e98 "
π­Ί««««««««ξώξώ"
s1=0x00332e99 "π­Ί««««««««ξώξώ"
s2=0x00332e9b "Ί««««««««ξώξώ"
}

after deallocation (with delete)

0x00332e98 <----- Is that a problem?
{
s0=0x00332e98 "" <-----
s1=0x00332e99 "3" <-----
s2=0x00332e9b "" <-----
}

thanks!
QuestionRe: Memory allocation Pin
David Crow12-Aug-08 4:19
David Crow12-Aug-08 4:19 
AnswerRe: Memory allocation Pin
Dennis L12-Aug-08 4:29
Dennis L12-Aug-08 4:29 
QuestionRe: Memory allocation Pin
David Crow12-Aug-08 4:36
David Crow12-Aug-08 4:36 
AnswerRe: Memory allocation Pin
Dennis L12-Aug-08 4:52
Dennis L12-Aug-08 4:52 
GeneralRe: Memory allocation Pin
David Crow12-Aug-08 5:18
David Crow12-Aug-08 5:18 
GeneralRe: Memory allocation Pin
Dennis L12-Aug-08 5:22
Dennis L12-Aug-08 5:22 
AnswerRe: Memory allocation Pin
Roger Stoltz12-Aug-08 4:41
Roger Stoltz12-Aug-08 4:41 
AnswerRe: Memory allocation Pin
sashoalm12-Aug-08 4:48
sashoalm12-Aug-08 4:48 
AnswerRe: Memory allocation Pin
Bram van Kampen12-Aug-08 9:03
Bram van Kampen12-Aug-08 9:03 
QuestionC++: How to declare constant array of pointers of TCHAR Pin
akirilov12-Aug-08 3:46
akirilov12-Aug-08 3:46 
AnswerRe: C++: How to declare constant array of pointers of TCHAR Pin
toxcct12-Aug-08 3:56
toxcct12-Aug-08 3:56 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
akirilov12-Aug-08 4:27
akirilov12-Aug-08 4:27 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
toxcct12-Aug-08 4:38
toxcct12-Aug-08 4:38 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
akirilov12-Aug-08 5:08
akirilov12-Aug-08 5:08 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
toxcct12-Aug-08 5:12
toxcct12-Aug-08 5:12 
GeneralRe: C++: How to declare constant array of pointers of TCHAR Pin
David Crow12-Aug-08 5:30
David Crow12-Aug-08 5:30 
QuestionAppilication hang during DB down Pin
krishnan.s12-Aug-08 3:32
krishnan.s12-Aug-08 3:32 

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.