compilation terminated. The terminal process terminated with exit code: 1头文件包含错误解决办法

错误描述:

d:\coding\clanguage\datastruct\chapterone\mian1.cpp:1:46: fatal error: c1.h: No such file or directory
  #include"c1.h"
                                             ^
compilation terminated.
The terminal process terminated with exit code: 1

最近笔者自己写头文件在使用时报错,解决了半天
后来发现是程序头文件路径有错误
如果不在工程同一个目录下,就得用绝对路径 #include<文件路径>或#include"文件路径" 文件路径可以是绝对路径,如:#include"D:\coding\clanguage\datastruct\chapterone\c1.h"
改成这样就没事了!

你可能感兴趣的:(c)