AnsweredAssumed Answered

M52233DEMO & CodeWarrior for CF V 7.1.2, Build 11 --  atoi() & atol() return 0

Question asked by Bill manzarek on Nov 15, 2009
Latest reply on Nov 16, 2009 by Bill manzarek

It seems atoi() & atol() always return 0. This is previous used, and working, code

from a 9S12 project (using cosmic c compiler). data_ptr points to a string

0x31, 0x30, 0x30,0x30,0x00. parameter_data is always written 0x00,0x00,0x00,0x00.


Just tried

             parameter_data = strtol(data_ptr, (char **)NULL, 10);


This function never returned.


Any & all ideas will be greatly appreciated.




uint32_t parameter_data; 

 char  *data_ptr;



          // convert string to a unsigned lword

                    parameter_data = atol(data_ptr);

Message Edited by billmanz on 2009-11-15 10:10 AM