I have this code.
sprintf((char *)pData,"%c%02X%c%02X% 02X",ASCII_STX,m_uSessionId,m_chSequenceChar,m_nMessageId,m_uVersion); NSLog("%@",pData);
But its not printing me contents pData. Tried with %d as a format specifier.
not printing
contents
%d
Try the following. It may not recognize pData as a string:
NSLog( @"%s", pData );
Perhaps you will use the Obj-C method?
NSString *pData = [NSString stringWithFormat:@"%c%02X%c%02X%02X", ASCII_STX, m_uSessionId, m_chSequenceChar, m_nMessageId, m_uVersion]; NSLog(@"%@",pData);