Pointers

5 replies [Last post]
YuSheng.Chen
Title: NooBot
Joined: 10/28/2013
Posts:
BotPoints: 286
User offline. Last seen 8 years 42 weeks ago.

Okay, on some of my recent posts, I have been talking about pointers. But, it seems as if nobody is using pointers. So now, my question is (especially to Jeremy), is there no point in using pointers, cause am I missing something obvious? For in programming memory is divided into the stack and heap. The overloading and the order that operations are called on on the stack is quite important. And, I feel that pointers would be a great benefit. So, am I missing something?

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 28 weeks ago.

A lot of Botballers who program in C don't find any need to use pointers. However, a lot of the more advanced programmers use pointers, and find great benefit from doing so. My KIPR Open code last year used pointers a lot. There are certain tasks in C/C++ which are much easier with pointers, but simple Botball programs frequently don't attempt to perform those tasks.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

YuSheng.Chen
Title: NooBot
Joined: 10/28/2013
Posts:
BotPoints: 286
User offline. Last seen 8 years 42 weeks ago.

Once again, I am glad that I didn't miss anything. Me, personally use pointers to allocate space on the heap. I find it really useful to alter functions with pointers. Thanks.

Marty Rand
Marty Rand's picture
Title: Botball Youth Advisory Council
Joined: 07/04/2009
Posts:
BotPoints: 253
User offline. Last seen 8 years 15 weeks ago.

Pointers are very useful. The thing is most Botball programs don't need that much complexity as Jeremy said. The one exception that I can think of is threading. pthread (the libary Linux uses for threading) requires pointers. My team's OpenCode library uses this heavily: https://github.com/normanadvanced/OpenCode . Feel free to extend it (or use it verbatim) for your robots. I recently uploaded the GCER 2013 build.

Enjoy!

-Marty Rand
{
Senior programmer at Norman Advanced Robotics

Former senior programmer at Whittier Middle School

Youth Advisory Council

All around nerd
}

YuSheng.Chen
Title: NooBot
Joined: 10/28/2013
Posts:
BotPoints: 286
User offline. Last seen 8 years 42 weeks ago.

Oh, thanks, this will probably be very useful. Thanks.

Carol G.
Title: NooBot
Joined: 04/26/2019
Posts:
BotPoints: 2
User offline. Last seen 3 years 31 weeks ago.

Pointers in a programming language are a pretty important factor and you can arrange your programming code easily. I truly like your update about the pointers and would like to suggest this https://www.paperwritingpro.com/ website for the best suggestions. I hope you like the expert's update.