CodeCogs - A iteractive open source Numerical library in C/C++, with wrappers for .NET and Excel Welcome... Login
Site Map
shopping cart
OSX compatibleWindows compatibleLinux compatible
Search CodeCogs
Numerical Components
Worked Examples

Valid RSS

strings

strtodouble vec

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 2.40
sub units 0.00
add a commercial licence to your cart
0
viewed 195 times and licensed 3 times

Converts a text comma or space seperated string of numbers into a double array

Controller: CodeCogs    Contact Controller

+View version details
Contents hide toc

Interface

#include <codecogs/strings/strtodouble_vec.h>

std::vector<double> strtodouble_vec (const char* str)
Converts a text comma or space seperated string of numbers into a double array

Function Documentation

 
std::vector<double>strtodouble_vecconst char*str )
Converts a text string of numbers, with each number seperated by a comma or space, into a dynamically allocated double precision array.

Example
#include<stdio.h>
#include<codecogs/strings/strtodouble_vec.h>
int main()
{
  const char input[]="12.3,34.5,33 23 45.3 2";
  std::vector<double> ans=strtodouble_vec(input);
  for(int i=0;i<ans.size();i++)
    printf("\n [%d] = %lf",i,ans[i]);
}

Output
 [0] = 12.300000
 [1] = 34.500000
 [2] = 33.000000
 [3] = 23.000000
 [4] = 45.300000
 [5] = 2.000000
Parameters:
strA text string of numbers, separated with commas or spaces [const]
Source Code:

You do not own any licences for this module.
To view or download source code you must get a GPL licence or buy a commercial licence.

buy now     get GPL     add to cart

For advanced download and development options Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2008-11-21 00:03:04

Valid CSS!   Valid XHTML 1.0 Transitional