I have a book that I am learning from and I am confused as when I should use the -> or the "."(dot)
also how do I know all the things I can put on the right side of a ->
is there an object browser like VB?
Printable View
I have a book that I am learning from and I am confused as when I should use the -> or the "."(dot)
also how do I know all the things I can put on the right side of a ->
is there an object browser like VB?
Use the dot when you are referencing a variable name.
Use the -> when are using an indirect (pointer) reference.
Code:struct complex {
double r;
double i;
} a;
void mm(void){
a.i=1;
a.r=(-1);
display(&a);
}
void display(struct complex *ptr){
printf("(%d,%d)\n",ptr->r,ptr->i );
return;
}
lets say the source code is huge how would you know that
ptr->r
is even available. Is there a more user friendly way to find out what my choices are?
You're thinking of the IDE in VB that does autocompletion.
In C you split modules into different source files, and put struct declarations into header files. You can open any header file and browse. Keep module size down to 300-400 lines at most.
Keep your functions restrained to doing just a few things.
FWIW - one VB statement often becomes dozens of lines of C++ code. CreateObject, for example is like this.
C works on a level that is far lower than VB - giving you more control and more work to do in coding.
Thank you for your help.
I will try to read through the header files.
I am programming for AutoCAD and the header files
were written by AutoDesk, the makers of AutoCAD
they call their collection of headers and libraries ObjectARX.
the problem is there are thousands of these itemms.
Thank you again for your help,
Visual C++ has an auto-completion feature, but it doesn't always work.
badgers -- This is why there are manuals for large SDKs.
Right. Nothing like a good (maybe online and cross-referenced) reference.