In a large C header file where defines many struct
, like following,
struct s1 {
...
};
struct s2{
int var_1;
int var_2;
int var_3;
...
int var_200;
...
int var_500;
};
struct s3{
...
};
I want to know var_200
belongs to which struct
, in this case, it is s2
.
Scrolling up in this case, not only slow, but also easy to miss the correct curly bracket(because there can be struct
in the struct
, there could be many curly bracket). Is there any good method to do this?
In Eclipse CDT, you can quickly find which struct a variable belongs to using Open Declaration (F3):
var_200
→ Eclipse will show the struct name in tooltipvar_200
→ Click "Open Declaration" (or press F3)var_200
is defined inside its structThis method works even if structs are deeply nested