User forums > Using Code::Blocks

Code-Completion doesn't work with struct variable for C?

(1/1)

kingfox:
Here is my C program:

--- Code: ---struct ComplexStruct
{
   int integerMember;
   float floatMember;
   char stringMember[128];
};

int main()
{
   struct ComplexStruct csObj1;
   struct ComplexStruct csObj2;

   return 0;
}

--- End code ---

when I type "csObj1." after the csObj2 declaration, the code-completion pull-down list didn't appear. But if I remove the "struct" keyword from "struct ComplexStruct csObj1;", every thing is OK.

Is it a bug of code-completion?

MortenMacFly:

--- Quote from: kingfox on March 27, 2009, 10:50:11 am ---Is it a bug of code-completion?

--- End quote ---
Not really. DO the following and it'll work:


--- Code: ---struct ComplexStruct
{
   int integerMember;
   float floatMember;
   char stringMember[128];
};
typedef struct ComplexStruct ComplexStruct;

--- End code ---

Notice that there are also patches around that handle typedefs a bit better. They are in testing phase and maybe applied in the furture...

Navigation

[0] Message Index

Go to full version