Author Topic: Code-Completion doesn't work with struct variable for C?  (Read 3795 times)

Offline kingfox

  • Multiple posting newcomer
  • *
  • Posts: 41
Code-Completion doesn't work with struct variable for C?
« 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?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Code-Completion doesn't work with struct variable for C?
« Reply #1 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...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ