Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: kingfox on March 27, 2009, 10:50:11 am

Title: Code-Completion doesn't work with struct variable for C?
Post by: kingfox on March 27, 2009, 10:50:11 am
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;
}

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?
Title: Re: Code-Completion doesn't work with struct variable for C?
Post by: MortenMacFly on March 27, 2009, 11:15:38 am
Is it a bug of code-completion?
Not really. DO the following and it'll work:

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

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