fhg@mace.cc.purdue.edu (J. F. Blake) (08/07/90)
<<Warning, novice question follows.>>
What would be the "best" way to read the following data? The code I have
works fine, but I am interested accepted style.
C 0.000000 0 0.000000 0 0.000000 0 0 0 0
H 1.100954 1 0.000000 0 0.000000 0 1 0 0
C 1.399112 1 119.509166 1 0.000000 0 1 2 0
C 1.399112 1 119.509166 1 180.000000 0 1 2 3
Currently I do the following:
FILE *fpin, *fpout, *fopen();
char line[80], atomic_symbol[3];
int i, j, k;
double x, y, z;
while (fgets(line, 80, fpin) != NULL) {
sscanf(line, "%s %lf %*d %lf %*d %lf %*d %d %d %d",
atomic_symbol, &x, &y, &z, &i, &j, &k);
}
Thanks.
Jim