Click here to Skip to main content
15,919,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Display Selected Folder Files Pin
anjita2-May-06 22:16
anjita2-May-06 22:16 
GeneralRe: Display Selected Folder Files Pin
Cedric Moonen2-May-06 22:22
Cedric Moonen2-May-06 22:22 
AnswerRe: Display Selected Folder Files Pin
Hamid_RT3-May-06 0:37
Hamid_RT3-May-06 0:37 
GeneralRe: Display Selected Folder Files Pin
anjita3-May-06 20:09
anjita3-May-06 20:09 
AnswerRe: Display Selected Folder Files Pin
Hamid_RT3-May-06 22:12
Hamid_RT3-May-06 22:12 
GeneralRe: Display Selected Folder Files Pin
anjita4-May-06 0:12
anjita4-May-06 0:12 
GeneralRe: Display Selected Folder Files Pin
anjita4-May-06 0:13
anjita4-May-06 0:13 
Questionabout swprintf and _stprintf Pin
George_George2-May-06 21:39
George_George2-May-06 21:39 
Hello everyone,


I find that _stprintf is defined to swprintf. And in the prototype of swprintf, the 1st and the 2nd parameters are both wchar_t. I think the other parameters should also be w_chart type, but in some situations, I always find others use char* type (which seems not unicode character type) as the parameter, like,

--------------------
// buffer is wchar_t* type.
_stprintf (buffer, L"%s", (char*)pointer);
--------------------

Definitions from Microsoft,

--------------------
#define _stprintf swprintf
_CRTIMP int __cdecl swprintf(wchar_t *, const wchar_t *, ...);
--------------------

Can we use char* as the 3rd parameter? If we can, why can it (non-unicode type) be compatible with wchar_t type (unicode type)?


thanks in advance,
George
AnswerRe: about swprintf and _stprintf Pin
toxcct2-May-06 21:43
toxcct2-May-06 21:43 
GeneralRe: about swprintf and _stprintf Pin
George_George2-May-06 21:50
George_George2-May-06 21:50 
GeneralRe: about swprintf and _stprintf Pin
toxcct2-May-06 21:56
toxcct2-May-06 21:56 
GeneralRe: about swprintf and _stprintf Pin
George_George2-May-06 22:07
George_George2-May-06 22:07 
AnswerRe: about swprintf and _stprintf Pin
Stephen Hewitt2-May-06 21:53
Stephen Hewitt2-May-06 21:53 
JokeRe: about swprintf and _stprintf Pin
Cedric Moonen2-May-06 21:58
Cedric Moonen2-May-06 21:58 
GeneralRe: about swprintf and _stprintf Pin
George_George2-May-06 23:20
George_George2-May-06 23:20 
GeneralRe: about swprintf and _stprintf Pin
Stephen Hewitt2-May-06 23:25
Stephen Hewitt2-May-06 23:25 
GeneralRe: about swprintf and _stprintf Pin
George_George3-May-06 2:24
George_George3-May-06 2:24 
GeneralRe: about swprintf and _stprintf Pin
Cedric Moonen2-May-06 23:27
Cedric Moonen2-May-06 23:27 
GeneralRe: about swprintf and _stprintf Pin
George_George3-May-06 2:27
George_George3-May-06 2:27 
GeneralRe: about swprintf and _stprintf Pin
George_George2-May-06 22:05
George_George2-May-06 22:05 
GeneralRe: about swprintf and _stprintf Pin
Stephen Hewitt2-May-06 22:09
Stephen Hewitt2-May-06 22:09 
GeneralRe: about swprintf and _stprintf Pin
George_George2-May-06 22:18
George_George2-May-06 22:18 
GeneralRe: about swprintf and _stprintf Pin
Stephen Hewitt2-May-06 23:23
Stephen Hewitt2-May-06 23:23 
GeneralRe: about swprintf and _stprintf Pin
George_George3-May-06 2:23
George_George3-May-06 2:23 
AnswerRe: about swprintf and _stprintf Pin
Michael Dunn2-May-06 22:54
sitebuilderMichael Dunn2-May-06 22:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.