?
Solved

cstring to number easy question

Posted on 1999-07-15
5
Medium Priority
?
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 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