0

I have defined a struct (let call it test) in file a.h, this struct should be used by many files. In the file b.h I need to use this struct, but not as a pointer (struct test a[32] and not struct test* a) as one of the attributes of another struct (let call it test_container). but I'm receiving error: array type has incomplete element type. I'm guessing it happening because the compiler does not know the test struct, so it can't determent how much space does test_container required. so I'm trying to add #include <a.h> in b.h, but then I'm receiving fatal error: a.h: No such file or directory. both files are in the same directory. what is the problem?

1
  • 2
    post code rather than a description of code. It's much easier to read, and more accurate. That said, you should probably #include "a.h" Commented Apr 28, 2020 at 16:04

1 Answer 1

1

Use #include "a.h" to include your own .h.

By the way you should post real code instead of description.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.