Solved

Convert const char* to double

Posted on 1997-12-17
4
1,090 Views
Last Modified: 2008-02-01
How do I convert const char* to double
0
Comment
Question by:wqclatre
  • 2
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
Comment Utility
#include <stdlib.h>
double d = atof("1.5");

#include <stdio.h>
sscanf("1.5","%lf",&d);


0
 
LVL 2

Author Comment

by:wqclatre
Comment Utility
Thanks!

Mark the question as answed!
0
 
LVL 84

Accepted Solution

by:
ozo earned 30 total points
Comment Utility
answed
0
 
LVL 2

Author Comment

by:wqclatre
Comment Utility
Thanks for answeing so fast!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now