Click here to Skip to main content
15,900,907 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Local Variable Address off by 4 bytes Pin
Mark Salsbery18-Mar-08 13:07
Mark Salsbery18-Mar-08 13:07 
GeneralRe: Local Variable Address off by 4 bytes Pin
ForNow18-Mar-08 14:59
ForNow18-Mar-08 14:59 
GeneralRe: Local Variable Address off by 4 bytes Pin
ForNow18-Mar-08 15:54
ForNow18-Mar-08 15:54 
GeneralRe: Local Variable Address off by 4 bytes Pin
Mark Salsbery18-Mar-08 16:13
Mark Salsbery18-Mar-08 16:13 
GeneralRe: Local Variable Address off by 4 bytes Pin
ForNow18-Mar-08 18:32
ForNow18-Mar-08 18:32 
QuestionRe: Local Variable Address off by 4 bytes Pin
Mark Salsbery18-Mar-08 19:40
Mark Salsbery18-Mar-08 19:40 
GeneralRe: Local Variable Address off by 4 bytes Pin
Mark Salsbery19-Mar-08 4:39
Mark Salsbery19-Mar-08 4:39 
GeneralRe: Local Variable Address off by 4 bytes Pin
ForNow19-Mar-08 14:39
ForNow19-Mar-08 14:39 
The atoi function seems to be giving me all kinds of grief

number = atoi(holdstr);
0037147D lea eax,[esp+4]
00371481 push eax
00371482 mov byte ptr [esp+esi+8],0
00371487 call dword ptr [__imp__atoi (37204Ch)]

When I cut'n paste this code the breakpoint was sitting on push inst

As you can see from the register value of eax
EAX = 0012FB18 EBX = 00000000 ECX = 0012FC3C EDX = 00729BEE ESI = 00000003 EDI = 78144BA8 EIP = 00371481 ESP = 0012FB14 EBP = 0012FF10 EFL = 00000246

Is a valid character string representation of 300

0x0012FB18 33 30 30 01 c0 c4 4a e4 18 0d c2 e3 10 00 12 00 00 ab 2f a3 a0 ab 4e 80 ff ff ff ff 00 00 02 00 00 50 fd

When I step by the call to atoi

00371487 call dword ptr [__imp__atoi (37204Ch)]
return number;
}
0037148D mov ecx,dword ptr [esp+108h] <--- currently here

The EAX register has the value I want X'12C' = decimal 300 However it never gets moved to number

Does I need to use something Like setlocale to get atoi working

Thankx

EAX = 0000012C EBX = 00000000 ECX = 00000020 EDX = 00000005 ESI = 00000003 EDI = 78144BA8 EIP = 0037148D ESP = 0012FB10 EBP = 0012FF10 EFL = 00000206
GeneralYou were right !!!!! Pin
ForNow19-Mar-08 17:35
ForNow19-Mar-08 17:35 
Generalurgent Pin
john563217-Mar-08 20:00
john563217-Mar-08 20:00 
GeneralRe: urgent Pin
rp_suman17-Mar-08 20:39
rp_suman17-Mar-08 20:39 
GeneralRe: urgent Pin
john563217-Mar-08 20:42
john563217-Mar-08 20:42 
GeneralRe: urgent Pin
rp_suman17-Mar-08 21:55
rp_suman17-Mar-08 21:55 
GeneralRe: urgent Pin
David Crow18-Mar-08 3:55
David Crow18-Mar-08 3:55 
GeneralRe: urgent Pin
Naveen17-Mar-08 21:21
Naveen17-Mar-08 21:21 
GeneralRe: urgent Pin
john563217-Mar-08 22:50
john563217-Mar-08 22:50 
GeneralRe: urgent Pin
Naveen17-Mar-08 23:29
Naveen17-Mar-08 23:29 
GeneralRe: urgent Pin
john563218-Mar-08 0:08
john563218-Mar-08 0:08 
GeneralRe: urgent Pin
Naveen18-Mar-08 0:19
Naveen18-Mar-08 0:19 
GeneralRe: urgent Pin
john563218-Mar-08 0:29
john563218-Mar-08 0:29 
GeneralRe: urgent Pin
fat_boy18-Mar-08 2:47
fat_boy18-Mar-08 2:47 
GeneralInheritance in Pimpl idiom Pin
George_George17-Mar-08 19:31
George_George17-Mar-08 19:31 
GeneralRe: Inheritance in Pimpl idiom Pin
Maxwell Chen17-Mar-08 20:01
Maxwell Chen17-Mar-08 20:01 
GeneralRe: Inheritance in Pimpl idiom Pin
George_George17-Mar-08 22:01
George_George17-Mar-08 22:01 
AnswerRe: Inheritance in Pimpl idiom [modified] Pin
Maxwell Chen17-Mar-08 20:43
Maxwell Chen17-Mar-08 20:43 

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.