source.h
来自「朴素贝叶斯c代码」· C头文件 代码 · 共 47 行
H
47 行
#ifndef SOURCE_H#define SOURCE_H#include <stdio.h>#include <stdlib.h>#include <malloc.h>#include <iostream.h>#include "util.h"#define MAXLEN 4096typedef float Description;class Source {private: FILE *handle; char *fname; char delimiter[1024]; char *where, *buffer; int n_Instances; // the number of rows int n_Descriptions; // the number of columnspublic: Source(char delim[]=",", char *fname=NULL); void init(); // reset the file pointer to the beginning Description readDescription(); // read a description void setDelimiter(char *delim) { strcpy(delimiter, delim); } int numOfInstances() { return n_Instances; } int numOfDescriptions() { return n_Descriptions; } // status() will give a status after read a char from the // input Description *readOneInstance(); char *getFileName() { return fname; }private: int countInstances(); int countDescriptions(); // class column also counted};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?