Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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


List of 29 messages in thread
TopicAuthorDate
Memory & strings; AT89C51            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: Memory & strings - Niklas            01/01/70 00:00      
ASCII or Binary?            01/01/70 00:00      
RE: ASCII or Binary?            01/01/70 00:00      
RE: ASCII or Binary?            01/01/70 00:00      
RE: ASCII or Binary?            01/01/70 00:00      
RE: ASCII or Binary?            01/01/70 00:00      
RE: ASCII or Binary?            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
Confirmed compatible with Tasking            01/01/70 00:00      
RE: Confirmed compatible with Tasking            01/01/70 00:00      
Typo in above post            01/01/70 00:00      
RE: Confirmed compatible with Tasking            01/01/70 00:00      
RE: Confirmed compatible with Tasking            01/01/70 00:00      
RE: Confirmed compatible with Tasking            01/01/70 00:00      
More details on memory errors            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: More details on memory errors            01/01/70 00:00      
RE: Memory & strings; AT89C51            01/01/70 00:00      
RE: More details on memory errors            01/01/70 00:00      
RE: More details on memory errors            01/01/70 00:00      

Back to Subject List