TCHAR* argv[]
에 텍스트를 입력하려면 어떻게해야합니까?char를 TCHAR * argv []로 변환하십시오.
또는 char
에서 TCHAR* argv[]
으로 변환하려면 어떻게해야합니까? 할
char randcount[] = "Hello world";
TCHAR* argv[];
argv = convert(randcount);
TCHAR* argv[]
에 텍스트를 입력하려면 어떻게해야합니까?char를 TCHAR * argv []로 변환하십시오.
또는 char
에서 TCHAR* argv[]
으로 변환하려면 어떻게해야합니까? 할
char randcount[] = "Hello world";
TCHAR* argv[];
argv = convert(randcount);
한가지 방법이다
char a[] = "Hello world";
USES_CONVERSION;
TCHAR* b = A2T(a);
#include "atlstr.h" – Expenzor
#include <iostream>
TCHAR* Converter(char* cha)
{
int aa = strlen(cha);
TCHAR* tmp = new TCHAR[aa+1];
for(int i = 0; i< aa+1; i++)
{
tmp[i]=cha[i];
}
return tmp;
}
int main()
{
char* chstr= new char[100];
chstr = "char string";
TCHAR* Tstr = new TCHAR[100];
//Below function "Converter" will do it
Tstr = Converter(chstr);
std::cout<<chstr<<std::endl;
std::wcout<<Tstr<<std::endl;
}
TCHAR *는 argv [] = _ T (이 "Helloworld"); \t 그것의 보여주는 오류 오류 C2440 : '초기화': 'TCHAR * argv [']와 별개로 시작 부분에 'const char [134]'에서 'TCHAR * []' – Sijith
You can missing " ]'는 TCHAR 포인터의 배열이고 문자열을 할당하려고합니다 : TCHAR * argv [10]; argv [0] = T ("HelloWorld");' – Naveen
이 TCHAR * \t ptszFirstInFile = _T ("sample1.asf")처럼 내 코드; TCHAR * \t ptszSecondInFile = _T ("sample2.asf"); TCHAR * \t ptszOutFile = _T ("xxxx.asf") ; 오류가 발생했습니다 'const char [12]'에서 'TCHAR *'로 변환 할 수 없습니다 – Sijith