Re: char array and pointer?
From: TomekG (tomgas_at_cntk.pl)
Date: 08/13/04
- Next message: Rola: "Re: char array and pointer?"
- Previous message: Scott McPhillips [MVP]: "Re: RC2182: duplicate dialog control ID 65534"
- In reply to: Rola: "Re: char array and pointer?"
- Next in thread: Rola: "Re: char array and pointer?"
- Reply: Rola: "Re: char array and pointer?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Aug 2004 13:30:19 +0200
Hi, Rola
LPTSTR == const char * "A 32-bit pointer to a character string that is
portable for Unicode and DBCSYou function returning pointer to string ,no
value char",msdn
LPTSTR NaVelke(TCHAR str[])
{
LPTSTR strTemp;
strTemp = ::CharUpper((LPTSTR)str);
return (strTemp + 2);
}
Function returning char (no pointer)
CHAR NaVelkeChar(TCHAR str[])
{
LPTSTR strTemp;
strTemp = ::CharUpper((LPTSTR)str);
return *(strTemp + 2);
}
Modify:
void Function1a()
{
TCHAR buff[] = "abcdefgh";
LPTSTR str="\0\0"; //str must ended by 0
*(str+0) = NaVelke(buff);
MessageBox(str, NULL, MB_OK);// you must construct null terminating
//string str only
for MessageBox
}
- Next message: Rola: "Re: char array and pointer?"
- Previous message: Scott McPhillips [MVP]: "Re: RC2182: duplicate dialog control ID 65534"
- In reply to: Rola: "Re: char array and pointer?"
- Next in thread: Rola: "Re: char array and pointer?"
- Reply: Rola: "Re: char array and pointer?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|