?
Solved

cstring to number easy question

Posted on 1999-07-15
5
Medium Priority
?
273 Views
Last Modified: 2013-11-20
How do i convert Cstring to a number?
Cstring A="123";
int q;

q=a?????

Thanks (i am pretty sure i saw this somewhere on the board, but I can't find it any longer)
0
Comment
Question by:Paullkha
  • 3
  • 2
5 Comments
 
LVL 23

Expert Comment

by:naveenkohli
ID: 1310079
Look at these function...

atof, atoi, _atoi64, atol

0
 
LVL 2

Author Comment

by:Paullkha
ID: 1310080
there is a way without using the c functions, but i forgot.
0
 
LVL 23

Accepted Solution

by:
naveenkohli earned 90 total points
ID: 1310081
CString A (_T ("123"));

      int i;
      float fp;

      sscanf( A, "%d", &i );
   sscanf( A, "%f", &fp );
0
 
LVL 2

Author Comment

by:Paullkha
ID: 1310082
Yep, that's more what I remember. - There are no new C++ libs that perform these type of conversions, correct?
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 1310083
yep!! thats what is used for these conversions :))

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Suggested Courses

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question