taylor taylor - 2 months ago 36
C Question

fatal error in stack

I use codeblocks to compile my code in C language.but I faced fatal error.
my code is:

#include<stdio.h>
#include<stack.h>


the fatal erroe is:

stack.h:No such a file or directory


What is my problem?

Answer
#include <filename.h>

is for standard/system headers that come with the language/compiler/operating system, for example:

#include <stdio.h>

includes a well-defined header file that is part of the C standard library for IO routines.

The C standard does not define a stack.h header file, so the file you are trying to include must be from another source.

If there is a file called stack.h in your project, then you need to use

#include "stack.h"

Beyond these two cases, we can't help you - stack.h sounds very much specific to your project/setup. If you know what directory it is in, you can try adding that directory as an include path to your IDE.