CFanatic

Go Back   CFanatic > Programming > C Programming

Join CFanatic Forum Now

string to double topic posted under C Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2006, 10:06 AM
Junior Member
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
kimw is on a distinguished road
| More
string to double

I have a string that i want to convert to double. i know atof is a standard library function for that, however, the input argument to atof is (const char*), not string type that i have.

does anyone know how i might convert my string num to double ? thanks

Code:
string num = "45.00";
double x = atof(num);
Reply With Quote
  #2  
Old 12-26-2006, 01:25 AM
Junior Member
 
Join Date: Dec 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Aztec is on a distinguished road
| More
Re: string to double

Quote:
Originally Posted by kimw View Post
I have a string that i want to convert to double. i know atof is a standard library function for that, however, the input argument to atof is (const char*), not string type that i have.

does anyone know how i might convert my string num to double ? thanks

Code:
string num = "45.00";
double x = atof(num);
string is C++ type. It's not part of C. Are you sure it's a C code?
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multibyte string conversions rajeshgalla C Programming 4 12-07-2010 07:40 AM
Where does the string gets stored? Iqbal_h_a C Programming 7 07-31-2008 04:24 PM
How to insert a string into string? Tran C Programming 3 05-21-2008 09:51 PM
rotate string iwdu15 C# Programming 0 09-29-2006 12:48 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:16 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board