LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-26-2006, 11:07 AM   #1
RHLinuxGUY
Member
 
Registered: Oct 2003
Distribution: Ubuntu 7.04
Posts: 889
Blog Entries: 1

Rep: Reputation: 30
? about code completion tool. ->


I opened up Dev-C++ on my win computer at school and it came up with a tip of the day, and it was use the code completion tool. And it showed a few of the following: "...", "." and "->". I have seen "->" before, how would I use this? Apparently it stores commands(?) in cache so you can use it once more in your code immediatly without having to type it all out(?). I'm guessing for like large function names or etc. Can someone clarify this? And how would I use it? When?
 
Old 01-26-2006, 12:00 PM   #2
SaintsOfTheDiamond
Member
 
Registered: Jan 2006
Location: Lexington, KY
Distribution: Arch and a little Slack
Posts: 139

Rep: Reputation: 15
Are you talking about in the code? The "->" is used for accessing and manipulating data with pointers.

I used Dev C++ when I'm working in Windows but I've never configured the code completion thing, so I guess I'm just spamming here.
 
Old 01-26-2006, 12:13 PM   #3
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
its not saying that you can program '->' like a macro or somthing.. it was giving you a list of what activates the code completion..

when you setup devc++ it will take a minute and scan all the system header files and create a completion database.. when you use a standard function, string for example.. it will pop up a prototype for you and if you hit enter it will complete the rest of the function.. example.

string s="hello";
s.le <---- now is when it should pop up the completion dialog hit enter and
s.length() it saves you some typing..
or if you were to be going through a pointer to a string..
s->le <--- again it should popup and let you hit enter..

though my version of devc++ i run in vmware sometimes usually does not work so well, it only pops up a protpotype after i finish typing.. ??

also i think it will also scan in you header files you create as you go.. its a nice little feature esp if you are not well versed in a particular set of functions... you can configure it somewhere in the editor options..

hth
 
Old 03-05-2006, 11:36 PM   #4
RHLinuxGUY
Member
 
Registered: Oct 2003
Distribution: Ubuntu 7.04
Posts: 889
Blog Entries: 1

Original Poster
Rep: Reputation: 30
My apologies for reviving a dead topic. I came across this in my SDL .cpp file(s)...

if (image->format->palette && screen->format->palette) {
SDL_SetColors(screen, image->format->palette->colors, 0,
image->format->palette->ncolors);

... So how does the -> (i.e. image->format->palette) work? Is it exactly like the auto complete feature like in dev-c++ or is that a negative? If negative, then what exactly is used for? Thank you in advance!!!
 
Old 03-05-2006, 11:49 PM   #5
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
in my experience i have not seen the auto complete work very well on additional headers.. such as the SDL headers..

so if you type image-> . . you are more than likely not going to have the auto complete come up..

however if you are using it on a class that you defined.. then it does usually work as expected..

i guess that is what you are asking ??
 
Old 03-06-2006, 12:13 AM   #6
RHLinuxGUY
Member
 
Registered: Oct 2003
Distribution: Ubuntu 7.04
Posts: 889
Blog Entries: 1

Original Poster
Rep: Reputation: 30
I think so.. I don't even exactly know what it is, other then what you told me. Thats why I asked. So I guess what you think I am asking is what I am asking. Viciouse cycle. Anyways.. it works.. but I don't remember defining it, maybe SDL does it automagicaly like the rest of their wonders. Anyways, so far I have an idea, but it seems as though it is not exactly KNOWN around here. I have searched the net but failed to bring any resources regarding it. Other then you and dev-c++ I don't have anything else to help me understand and use it properly in the future. Thank you so far though xhi, because even though you may not think your giving me the full answer you think I want, you pushed me in the direction I need to go.
 
Old 03-06-2006, 12:32 AM   #7
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Code:
Anyways.. it works.. but I don't remember defining it,
you are aware that '->' is a c/c++ operator correct?

im not trying to get to 'spoon-feedishly' here.. and if you already know this just ignore it.. but i wonder after rereading the post if i had been misunderstanding you..

again just ignore this post if you already knew..

move along folks.. nothing to see here..

this may become part of the "Viciouse cycle"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kylix 3 Code Completion error J3N7iL Linux - Software 0 11-23-2005 07:19 PM
emacs, code completion phoenix7 Programming 5 09-22-2005 09:51 AM
code completion in KDevelop dvm Programming 1 05-15-2005 06:35 AM
does vim have an option for code completion? sneak Linux - Software 4 07-20-2004 07:05 AM
Anjuta and code completion supermatt Linux - Software 0 06-17-2004 09:41 PM


All times are GMT -5. The time now is 04:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration