包含文件无效c ++

时间:2018-03-28 16:09:20

标签: c++ include header-files

我创建了一个头文件以包含其他头文件作为快捷方式,它几乎适用于我的所有文件,但我一直遇到我的文件i / o文件的问题(它引发了不包括文件的错误) 。
包含文件(includes.h)

#ifndef INCLUDES_H_
#define INCLUDES_H_
#include <vector>
#include "html.h"
#include "file.h"
#include <string>
#include "test.h"
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <cstdlib>
#endif

文件(file.h)

#ifndef FILE_H_
#define FILE_H_
#include "includes.h"
namespace file
{
    int file()
    {
    std::string filename;
    std::cout <<"What would you like to name your file?\n";
    std::cout << "(don't put in the .html)\n";
    std::cin >> filename;
    filename = filename +".html";
    std::ofstream outf(filename);
    return 0;
    }
}
#endif 

1 个答案:

答案 0 :(得分:1)

您不应该在def insert_breaks(x,y): import datetime as dtm import numpy as np xnew = [] ynew = [] for dt1, dt0, y1, y0 in zip(x[1:],x[:-1],y[1:],y[:-1]): if dt1-dt0 < dtm.timedelta(hours=1): xnew+=[dt0] ynew+=[y0] else: xnew+=[dt0,dt0+(dt1-dt0)/2] ynew+=[y0, np.nan] xnew+=[dt1] ynew+=[y1] return xnew, ynew 文件中包含files.h

制作一个庞大的包含文件似乎总的来说是个坏主意。无论是否真的需要,所有东西都随处可见。这可能会导致难以诊断错误。

只包含您需要的东西。