String to char *array
-
Hey dudes! I am using VS 2005 and doing work in Visual C++ windows Applications. I am facing a prob that i have a class in which my data members are char * but when i get data from text box or edit box it is in the form of String. But i have to convert it into char*. How can i do it?? I got how to convert char * to string by COnvert::ToString(char*). And other one problem is that when i add a class, when i add data member as String or String^ it didn't allow me. To do it which header file Should i include??
Regards: Xohaib Shirani
-
Hey dudes! I am using VS 2005 and doing work in Visual C++ windows Applications. I am facing a prob that i have a class in which my data members are char * but when i get data from text box or edit box it is in the form of String. But i have to convert it into char*. How can i do it?? I got how to convert char * to string by COnvert::ToString(char*). And other one problem is that when i add a class, when i add data member as String or String^ it didn't allow me. To do it which header file Should i include??
Regards: Xohaib Shirani
This question may be more relevant in the C++/MFC forum. Regards, --Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia Introduction to Object-Oriented JavaScript
-
This question may be more relevant in the C++/MFC forum. Regards, --Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia Introduction to Object-Oriented JavaScript
Yea i know it's the question of C++ but when i use the same application in .NEt. i can include . But it didn't allow me to add in VS 2005 :( so what should i do ?? I tried using namsespce std and using system std. So how can i include the file ???? I did the same work in .Net 2003 envirnment
Regards: Xohaib Shirani
-
Hey dudes! I am using VS 2005 and doing work in Visual C++ windows Applications. I am facing a prob that i have a class in which my data members are char * but when i get data from text box or edit box it is in the form of String. But i have to convert it into char*. How can i do it?? I got how to convert char * to string by COnvert::ToString(char*). And other one problem is that when i add a class, when i add data member as String or String^ it didn't allow me. To do it which header file Should i include??
Regards: Xohaib Shirani
declare a myCharPtr which doesn't have any embedded nulls and be sure that it is large enough. And use following command- strcpy(myCharPtr, my_string.c_str()) I think it should work...but not sure.
"We can't solve problems by using the same kind of thinking we used when we created them"