News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

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

Started by kingfox, March 27, 2009, 10:50:11 AM

Previous topic - Next topic

kingfox

Here is my C program:

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?

MortenMacFly

Quote from: kingfox on March 27, 2009, 10:50:11 AM
Is it a bug of code-completion?
Not really. DO the following and it'll work:


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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]