473,396 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to change variable's type? MC++

Hi
i need to change a variables' type from String to Int in managed c++ but dunno how to. Do any1 know how i can do this?
Regards
Tom
Oct 15 '08 #1
1 984
misza
13
Provided that the string contains a valid integer you can use this:
int yourint = System::Convert::ToInt32(yourstring);

You can also use this, which is i guess an even better option:
int yourint;
if(System::Int32::TryParse(yourstring, yourint))
{
// do sth with the int <yourint>
}
else
{
// the string is not a valid int
}

hope that helps,
michal
Oct 15 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jim Mc | last post by:
Using JavaScript, can I tag a block of text and then change the text appearing in that block? I'm doing a type of calculator and I'd like to display the resulting number in a <td> (or div or...
2
by: Daniel Lidström | last post by:
Hi, I would like to know the cleanest way to change the serialization of my Line class from: <Line staStart="2327.02" length="10.00000003390744"> <End>549016.570965 57945.741122</End>...
8
by: Craig Klementowski | last post by:
All, I've installed the VS 2005 Beta 1 and was trying to build our current product. I get a compile error when enum value is specified with classname::enumname::enumvalue. Seems the compiler...
2
by: tzvika.visman | last post by:
I write a MC++ wrapper for our company internal SDK that wrote in C++ native code for writing application with this SDK over C# and other .NET languages and most of my SDK API function return a...
3
by: Marc Castrechini | last post by:
I have a page that changes an <ASP:Checkbox value based on a user entered value in a textboxm using client side Javascript. After my submit is fired the value for the chkMyCB.checked does not get...
6
by: Marc Robitaille | last post by:
Hello, Hello, I developed a UserControl. It has funny behavior. It is composed of three controls. A texbox, a combobox and a button. There are three properties to indicate the visibility of...
3
by: RSH | last post by:
Hi, I have a situation where I have a page built in .Net 1.1 that I have a PlaceHolder in the Design. From the CodeBehind I am dynamically referencing a user control. This is a snippet from...
6
by: recherche | last post by:
Hi! Is the following program valid, although it compiles and executes successfully? // params modifier // used to declare array parameter // value type, no constructor using System;
6
by: Annonymous Coward | last post by:
I am relatively new in C#, but have several years C++/Java. I am writing a little C# console app to "test the waters" and learn the language. If I have a class defined as: class MyClass {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.