아래의 속성 수정

프로젝트->속성->구성속성->일반->프로젝트 기본값->공용 언어 런타임 지원 = 공용 언어 런타임 지원(/clr)

(컴파일 하면 에러 발생하면 하나하나씩 컴파일 옵션 처리해주면 된다)

 

#include <iostream>

#include <stdlib.h>

#include <string.h>

#include "msclr\marshal_cppstd.h" 

 

using std::cout;

using std::endl;

using std::string;

 

using namespace System;

using namespace msclr::interop;

 

void main()

{

         String ^s = "abc";

        

         string unmanaged = marshal_as<std::string>(s->ToUpper());

 

         cout << unmanaged << endl;

}

 

 

'기타 > C++' 카테고리의 다른 글

Native C++에서 C++/CLR 클래스 사용하기  (0) 2015.03.06
콘솔싸이월드  (0) 2011.01.20
비트학생관리  (0) 2011.01.20

+ Recent posts