|
-
Nov 20th, 2002, 10:07 AM
#1
Thread Starter
Hyperactive Member
-> and dot
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?
I am so skeptical, I can hardly believe it!
PS I am not a 'hyperactive member' I am a cool, calm, and collected member 
-
Nov 20th, 2002, 10:26 AM
#2
Frenzied Member
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;
}
-
Nov 20th, 2002, 10:37 AM
#3
Thread Starter
Hyperactive Member
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?
I am so skeptical, I can hardly believe it!
PS I am not a 'hyperactive member' I am a cool, calm, and collected member 
-
Nov 20th, 2002, 11:02 AM
#4
Frenzied Member
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.
-
Nov 20th, 2002, 11:53 AM
#5
Thread Starter
Hyperactive Member
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,
I am so skeptical, I can hardly believe it!
PS I am not a 'hyperactive member' I am a cool, calm, and collected member 
-
Nov 22nd, 2002, 08:38 AM
#6
Visual C++ has an auto-completion feature, but it doesn't always work.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 22nd, 2002, 08:39 AM
#7
Monday Morning Lunatic
badgers -- This is why there are manuals for large SDKs.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 22nd, 2002, 09:16 AM
#8
Right. Nothing like a good (maybe online and cross-referenced) reference.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|