read_segy_cfg.c

来自「这是matlab在地球物理数据处理方面的源码」· C语言 代码 · 共 41 行

C
41
字号
#include <stdlib.h>
#include <stdio.h>

#define  BUFL	128

struct Station
{  char    stationsname[16];
   double laenge;
   double breite;
   double hoch;
   double rechts;
   int    elevation;
   int    PDAS_Nr;
   int    Kanal;
};

int search_PDAS (struct Station *stat, int pdas, FILE *ali)
{ 
  int  i;
  char buf[BUFL];

  while(!feof(ali))
  { if (!fgets (buf,BUFL,ali)) 	 		break;

    if (*buf == '#')               		continue;


    i = sscanf (buf,"%s %lf %lf %lf %lf %d %d \n",
		stat->stationsname,
		&stat->breite,
		&stat->laenge,
		&stat->hoch,
		&stat->rechts,
		&stat->elevation,
		&stat->PDAS_Nr );
     
    if ( pdas == stat->PDAS_Nr )    return (1);
  }
  return (0);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?