IT Community - Software Programming, Web Development and Technical Support

How to do a type conversion in VC++ .NET?

This is a discussion on How to do a type conversion in VC++ .NET? within the C and C++ Programming forums, part of the Software Development category; How to do a type conversion in VC++ .NET?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-23-2007, 01:26 AM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Question How to do a type conversion in VC++ .NET?

How to do a type conversion in VC++ .NET?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-31-2007, 03:55 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Smile Re: How to do a type conversion in VC++ .NET?

Hi,
We can convert the Char * into string eachother using the following line.

const char *val = "test";
std::string valString(val);

Now valString contains "test".


std::string val = "test";
char * valChar = new char[val.length()+1];
strcpy(valChar, val.c_str());
__________________
The OXYGEN
Delivers edgy, intelligent Technology to all...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-10-2007, 05:38 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Default Re: How to do a type conversion in VC++ .NET?

The actual question does not specify which datatype has to be converted. In general, Type casting can be used to convert between datatypes.

eg:-

float f=5.5;
int i=(int)f;
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conversion from ogg to mp3 JSureshkumar Operating Systems 33 04-10-2008 09:44 PM
Conversion error Kirubhananth ASP and ASP.NET Programming 4 03-12-2008 10:03 PM
Conversion constructor vijayanand C and C++ Programming 0 09-21-2007 03:36 AM
What is Value type and reference type in .Net? anbuchezhians VB.NET Programming 2 08-21-2007 10:42 PM
Type conversion from arraylist to string in C# oxygen C# Programming 3 07-30-2007 09:47 AM


All times are GMT -7. The time now is 05:22 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0