Questions tagged [incomplete-type]

In the C and C++ languages, an incomplete type is "lacking sufficient information to determine the size of objects of that type." (Examples: variable-length arrays, forward declarations of `struct`s, and the `void` type.)

In the C and C++ programming language, an incomplete type is

"lacking sufficient information to determine the size of objects of that type."ISO C11 standard, section 6.2.5

Examples:

The standard mentions the following three instances of incomplete types:

  1. an array type of variable, or unknown size, such as char *argv[].
  2. a type that describes an object but lacks information to determine their sizes, such as struct foo_tag;
  3. the void type (which, unlike the other two, cannot be completed)

Resources:

310 questions
-1
votes
1 answer

C - Dereferencing pointer to incomplete type - insert string into Binary Search Tree

I get a dereferencing pointer to incomplete type on line 58: rootNode->_left = NULL. Any ideas? Also there is a lot of code commented out to single out this error but I have another question about the format of this ADT: The usual Binary Search Tree…
StefanBob
  • 3,987
  • 2
  • 21
  • 34
-1
votes
1 answer

Incomplete Implementation View Controller

I am making an app in Xcode. It is my first app and I'm getting an error that says "Incomplete Implementation" in my ViewController.m file. Here is the line of code where I get the error: @implementation ViewController : UIViewController;
-2
votes
2 answers

I keep getting the error invalid use of incomplete type 'struct familyFinace' how do I fix this?

I am trying to append a node but I keep getting the error incomplete type 'struct familyFinace' how do I fix this? #include #include #include #include using namespace std; struct familyFinance{ …
Pokmons222
  • 49
  • 7
-2
votes
1 answer

C Field has incomplete type, without forward declaration

I keep getting the "field has incomplete type error," but I can't find any forward declarations for that type in my code, or for any of the types in it's struct--aside from pointer fields. I tried recursive grep the folder, and still couldn't find…
Patrick Jeeves
  • 357
  • 2
  • 13
-2
votes
2 answers

C error: dereferencing pointer to incomplete type, struct

I know this question is asked tons of times, but I cannot seem to link it to my problem. My problem is something to do with filling out a web of structs Here is my buggy code src\fpu.c:17:7: error: dereferencing pointer to incomplete type …
SSpoke
  • 5,239
  • 8
  • 66
  • 112
-2
votes
1 answer

Defining custom iterator over map object: mysterious "incomplete type" errors

I cannot define a custom iterator over std::map because Foo is an "incomplete type". What is wrong and how can I fix it so the custom iterator is defined correctly? More specifically, I have a map object in another class Bar: struct Bar{ …
kdog
  • 1,423
  • 11
  • 25
-3
votes
1 answer

C++ compiler option to allow the use of incomplete type in classes that make use of each other?

Is there a compiler option that will allow the following code to compile, without moving the function definition to the bottom? class first{ int a; void func(second b){} }; class second{ int a; void func(first b){} };
-4
votes
1 answer

Why can't I dynamic_cast this object?

void test() { Token test(); Actor* check; check = dynamic_cast(test); } This method gives me the following error and underlines the test in the braces with red. The operand of a pointer dynamic_cast must be a pointer…
user3330027
  • 1
  • 1
  • 2
-5
votes
3 answers

Declaring array without specifying the row size?

How can a[][3] declaration is right where as a[3][] is wrong in C?
-11
votes
3 answers

When is forward declaration not enough?

The #include problem class widget { }; class fubar : public widget { // 1 void value_parameter(widget); // 2 void ref_parameter(widget &); // 3 void ptr_parameter(widget *); // 4 virtual void value_parameter(widget); // 5 …
1 2 3
20
21