Re: conversion of types.
- From: Joe Wright <joewwright@xxxxxxxxxxx>
- Date: Sat, 05 Aug 2006 12:17:35 -0400
jj_76 wrote:
hello,
I have a data file with several columns consisting of double values. I
am reading the whole row as a string using fgets(). I want to convert
each column back into a double. It seems atof() converts only the first
column and strtod() also does the same. Is there any other way ?
thanks
------------
FILE *fp1;
char thing1[61];
double mtot;
fgets(thing1,61,fp1);
mtot = atof(thing1);
What is the actual format of the file? Are there a fixed number of columns (fields) per row? How are the fields delimited?
--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
.
- Follow-Ups:
- Re: conversion of types.
- From: CBFalconer
- Re: conversion of types.
- References:
- conversion of types.
- From: jj_76
- conversion of types.
- Prev by Date: Re: Determining Variable type
- Next by Date: Re: how to detect the compile is 32 bits or 64 bits?
- Previous by thread: Re: conversion of types.
- Next by thread: Re: conversion of types.
- Index(es):
Relevant Pages
|