View topic - Implementing # flag in qnx.
Implementing # flag in qnx.
4 posts
• Page 1 of 1
Implementing # flag in qnx.
Hi,
I have been trying to implement Format function of CTime class(MFC) in qnx.
For that i used strftime(size_t strftime( char * s,
size_t maxsize,
const char * format,
const struct tm * timeptr ))
While in visual studio, format (%s, %M etc.) could be passed on along with # flag(EG. %#I) to remove leading zero, while the same is not the case with qnx and its not idenfied, please suggest an alternative.
I have been trying to implement Format function of CTime class(MFC) in qnx.
For that i used strftime(size_t strftime( char * s,
size_t maxsize,
const char * format,
const struct tm * timeptr ))
While in visual studio, format (%s, %M etc.) could be passed on along with # flag(EG. %#I) to remove leading zero, while the same is not the case with qnx and its not idenfied, please suggest an alternative.
- BibinZ
- New Member
- Posts: 3
- Joined: Fri Nov 06, 2009 4:54 am
RE: Implementing # flag in qnx.
Look at struct tm in /usr/include/time.h. It has all the variables. You can format your string any way that you wish with sprintf().
- maschoen
- QNX Master
- Posts: 2657
- Joined: Wed Jun 25, 2003 5:18 pm
RE: Implementing # flag in qnx.
sprintf does allows formatting, but it seems it doesn't provide any flag to remove the leading zero, please correct me if im wrong..
- BibinZ
- New Member
- Posts: 3
- Joined: Fri Nov 06, 2009 4:54 am
RE: Implementing # flag in qnx.
I don't know why you would be getting a leading zero. Can you post your sprintf statement.
- maschoen
- QNX Master
- Posts: 2657
- Joined: Wed Jun 25, 2003 5:18 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests