Skip navigation.
Home
The QNX Community Portal

View topic - Implementing # flag in qnx.

Implementing # flag in qnx.

Isn't the name clear?

Implementing # flag in qnx.

Postby BibinZ » Fri Nov 06, 2009 5:03 am

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.
BibinZ
New Member
 
Posts: 3
Joined: Fri Nov 06, 2009 4:54 am

RE: Implementing # flag in qnx.

Postby maschoen » Fri Nov 06, 2009 3:37 pm

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: 2640
Joined: Wed Jun 25, 2003 5:18 pm

RE: Implementing # flag in qnx.

Postby BibinZ » Sat Nov 07, 2009 9:36 am

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.

Postby maschoen » Sat Nov 07, 2009 5:48 pm

I don't know why you would be getting a leading zero. Can you post your sprintf statement.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 3 guests