6 registered members (TipmyPip, Niels, dBc, Ed_Love, 3run, 1 invisible),
17,577
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: pointer problems.
[Re: txesmi]
#408737
10/06/12 11:58
10/06/12 11:58
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
well.. I have never really understood what pointers are and how to use them properly... 
Last edited by Kartoffel; 10/06/12 11:58.
POTATO-MAN saves the day! - Random
|
|
|
Re: pointer problems.
[Re: Kartoffel]
#408743
10/06/12 16:13
10/06/12 16:13
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
OP
Expert
|
OP
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
There are not a lot of reasons you would want to use a variable as a pointer. In fact this is the first time I have ever needed to and this is getting on 10 years of programming for me. However now that I know I might find it more useful and use it far more often.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: pointer problems.
[Re: FoxHound]
#408750
10/06/12 17:51
10/06/12 17:51
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
There are tons of reasons to use a var as pointer, function calls by ref or by value are just one of them. Guys, pointers are your bread and butter when working with C, and they will break your neck when you don't get them right (they will still do when you can get them right, but at least you can debug it then). So learn your goddamn pointers!
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: pointer problems.
[Re: WretchedSid]
#408751
10/06/12 18:43
10/06/12 18:43
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
OP
Expert
|
OP
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
Other than the two examples provided, what else could they help with? Even the function call could be replaced with having the function return the value. I am being serious as I have not had a need for them before now.
It is quite helpful with my dashboard as it allows me to save about 1000 lines of code and makes it far more dynamic when using other items.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: pointer problems.
[Re: FoxHound]
#408752
10/06/12 19:03
10/06/12 19:03
|
Joined: Apr 2008
Posts: 650
Sajeth
User
|
User
Joined: Apr 2008
Posts: 650
|
When you need to change two variables with a single function call, you're forced to use pointers.
Teleschrott-Fan.
|
|
|
Re: pointer problems.
[Re: Sajeth]
#408795
10/07/12 17:16
10/07/12 17:16
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
OP
Expert
|
OP
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
That is true. I was not thinking of vars passed into functions, there are dozens of built in functions in 3dgs that we use all the time. I am more thinking of odd ways to use them, such as my dashboard example.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
|