| ??? 05/03/02 02:02 Read: times |
#22439 - RE: ASCII or Binary? |
Can somebody tell me how to correct my code to send a pointer instead of the string? I'm not very good at dealing with pointers.
First of all, in 'C', any string is a pointer. Given your code below: char numstr[10]; unsigned long num = 500; sprintf( numstr, "%lu", num ); The variable numstr is technically a "string pointer." It's commonly called a "string" for short. But whenever you refer to a string you are actually working with a pointer that points TO the string. That said, I just compiled the above code in Microsoft Visual C++, Keil Software uVision2, and IAR Embedded Workbench and the above code works in all of them. I really can't imagine why the above wouldn't work under Tasking and, unfortunately, I don't have the Tasking compiler here so I can't test it. The code is very straight-forward 'C' and works under the three compilers I tested with--two of which are 8052 compilers. Regards, Craig Steiner |



