Shamoozal.com - Smorgas Board

Official Forum of Shamoozal.com
It is currently May, 20, 2013 - 1:11pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Pointers
PostPosted: January, 23, 2011 - 2:13am 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
Fuck pointers. Just getting more and more confused.

*programming stuff


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 5:15am 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
I love helpful internet people.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 12:33pm 
Offline
Shamoozal Legend
User avatar

Joined: June, 7, 2005 - 10:44pm
Posts: 20472
Location: New Mexico
Quit your crying. If you need help, ask for it instead of going around crying about it when no one responds to your posts. I would have helped you out if I saw this. We can't always be sitting around here waiting for Dante to post his problems on the smorg. We have other stuff going on in our lives too you know.

_________________
"If you always put limit on everything you do, physical or anything else. It will spread into your work and into your life. There are no limits. There are only plateaus, and you must not stay there, you must go beyond them. "


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 12:50pm 
Offline
Shamoozal Vet
User avatar

Joined: December, 20, 2006 - 12:06am
Posts: 4505
Location: Pa
Image

_________________
- Oh, great. You killed the invisible swordsman!
-- He's dead, all right.
--- How was I supposed to know where he was?
- You were supposed to fire up. _We_ both fired _up_.
Image


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 12:53pm 
Offline
Purple Heart
User avatar

Joined: June, 19, 2007 - 11:40pm
Posts: 6280
Location: Oklahoma
Russell Casse wrote:
Quit your crying. If you need help, ask for it instead of going around crying about it when no one responds to your posts. I would have helped you out if I saw this. We can't always be sitting around here waiting for Dante to post his problems on the smorg. We have other stuff going on in our lives too you know.


Calm down, I don't think he was being sarcastic in his second post.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 1:34pm 
Offline
Shamoozal Legend
User avatar

Joined: June, 7, 2005 - 10:44pm
Posts: 20472
Location: New Mexico
It's kind of hard to tell. Dante has a knack of doing that.

Pointers are a references to a section of memory. You have memory and you store crap in it. When you need to read that portion of memory or use it, you pass a pointer to it and the computer will know where to look for data. That's pretty much the simplest explanation of pointers.

_________________
"If you always put limit on everything you do, physical or anything else. It will spread into your work and into your life. There are no limits. There are only plateaus, and you must not stay there, you must go beyond them. "


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 2:22pm 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
Russell Casse wrote:
Quit your crying. If you need help, ask for it instead of going around crying about it when no one responds to your posts. I would have helped you out if I saw this. We can't always be sitting around here waiting for Dante to post his problems on the smorg. We have other stuff going on in our lives too you know.


Second post was because some wonderful neogaf poster helped me out.

I understand the basics of pointers, but for this assignment we have to use an unnecessary amount of indirection to show we understand it. We have to declare a pointer to a pointer to a pointer to a vector and dynamically allocate everything but the initial pointer.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 4:53pm 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
vector<string>*** p = new vector<string>** p;
*p = new vector<string>*;
**p = new vector<string>;

COWER IN FEAR OF MY POINTERS.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 5:22pm 
Offline
Purple Heart
User avatar

Joined: June, 12, 2006 - 12:32pm
Posts: 9533
Russel may have just gotten probed. They may have done things to him...sexually.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 5:45pm 
Offline
Shamoozal Legend
User avatar

Joined: June, 7, 2005 - 10:44pm
Posts: 20472
Location: New Mexico
IratePrimate wrote:
Russel may have just gotten probed. They may have done things to him...sexually.


We gotta stop'em!

_________________
"If you always put limit on everything you do, physical or anything else. It will spread into your work and into your life. There are no limits. There are only plateaus, and you must not stay there, you must go beyond them. "


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 5:48pm 
Offline
Artist of Life
User avatar

Joined: June, 7, 2005 - 8:11pm
Posts: 10594
Location: South Jersey
I picked a hell of a day to quit drinking...

_________________
Image


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 5:49pm 
Offline
Shamoozal Legend
User avatar

Joined: June, 7, 2005 - 10:44pm
Posts: 20472
Location: New Mexico
Oh, then I don't know. I haven't programmed in C++ in ages.

_________________
"If you always put limit on everything you do, physical or anything else. It will spread into your work and into your life. There are no limits. There are only plateaus, and you must not stay there, you must go beyond them. "


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 7:06pm 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
I just realized that in the example this dude was helping me with, the data that I was pushing into the vector was "ass butt donk". How embarassing, hahahaha.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 23, 2011 - 8:43pm 
Offline
Purple Heart
User avatar

Joined: June, 12, 2006 - 12:32pm
Posts: 9533
Ahahahahahahahaha!


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: January, 27, 2011 - 6:30pm 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
This person in my class last night couldn't figure out what was wrong with their program, so they had the teacher look at it. Every time they compiled it, the "build errors" window came up, then they built it anyways and couldn't figure out why it was wrong. This is a second level class.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: March, 6, 2011 - 1:35pm 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
My last programming assignment was doing operator overloading on our Fraction class we made last time. One of them was the increment operator (++, adds 1), and I just couldn't get it to work and get the same results as the instruction. Turns out my teacher implemented it in such a way where it increments both the numerator and the denominator, so 3/4 would become 4/5. Completely mathematically incorrect. :?


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: September, 2, 2011 - 6:40pm 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
This is now my programming whore daddy thread where I talk to myself. C++ templates are the worst.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: September, 3, 2011 - 2:58am 
Offline
Sergeant Major Manf
User avatar

Joined: November, 7, 2006 - 1:52am
Posts: 1457
Location: NJ
I don't think I ever dealt with templates.... By the time I was doing class derivatives and overloads we had moved on to object oriented and were using Java. Then we started using LISP and all hell breaks loose once your mind explodes at the fact that you can have LISP code write other LISP code on the fly and change its own programming as it is executing.... That is after you can figure out how many freaking (((((()))))))'s you have....

_________________
Bowie wrote:
Why am I getting lectured about Final Fantasy? Eat shit how about that.


Image


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: September, 3, 2011 - 3:04am 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
Fallen Kell wrote:
I don't think I ever dealt with templates.... By the time I was doing class derivatives and overloads we had moved on to object oriented and were using Java. Then we started using LISP and all hell breaks loose once your mind explodes at the fact that you can have LISP code write other LISP code on the fly and change its own programming as it is executing.... That is after you can figure out how many freaking (((((()))))))'s you have....

Is LISP commonly used for anything? I've heard of the notorious parentheses, hahaha.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: September, 3, 2011 - 3:23am 
Offline
Sergeant Major Manf
User avatar

Joined: November, 7, 2006 - 1:52am
Posts: 1457
Location: NJ
It is used in just about all AI coding, as stated because it can change its code on the fly. It is also very dynamic, more so than any other language due to the fact that LISP follows the rules of Lambda Calculus, which is the math and science which makes programming work. If it is possible to program something, it can be programmed in LISP. Other languages can not say the same thing. There are quite a few places which were using LISP to generate their websites a while back due to the fact that they can change their code while people are accessing the site dynamically.

_________________
Bowie wrote:
Why am I getting lectured about Final Fantasy? Eat shit how about that.


Image


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: October, 14, 2011 - 1:17pm 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
Terrible day of implementing templated binary trees and search trees incoming...


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: October, 14, 2011 - 1:31pm 
Offline
Shamoozal Legend
User avatar

Joined: June, 7, 2005 - 10:44pm
Posts: 20472
Location: New Mexico
Spend the time to learn them well because they're going to grill you on it in the interviews.

_________________
"If you always put limit on everything you do, physical or anything else. It will spread into your work and into your life. There are no limits. There are only plateaus, and you must not stay there, you must go beyond them. "


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: October, 18, 2011 - 12:09pm 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
Man, I was trying to figure out how to pass a member function pointer around within a class and it is a god damn nightmare. The syntax is disgusting.


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: October, 18, 2011 - 12:18pm 
Offline
Shamoozal Legend
User avatar

Joined: June, 7, 2005 - 10:44pm
Posts: 20472
Location: New Mexico
Why are you doing that for? Man, I hated pointers in C++ too. Good thing all I do now is program in Java and Python. I don't have to do anything with pointers myself anymore.

_________________
"If you always put limit on everything you do, physical or anything else. It will spread into your work and into your life. There are no limits. There are only plateaus, and you must not stay there, you must go beyond them. "


Top
 Profile  
 
 Post subject: Re: Pointers
PostPosted: October, 18, 2011 - 1:14pm 
Offline
The Bearer of Truths
User avatar

Joined: May, 21, 2006 - 6:30pm
Posts: 12271
Russell Casse wrote:
Why are you doing that for? Man, I hated pointers in C++ too. Good thing all I do now is program in Java and Python. I don't have to do anything with pointers myself anymore.

We had to overload the stream insertion (<<) operator for our trees. The class had some private traversal functions that took function pointers from the client, so my plan was to just make a function that output the data, and the pointer to that function would be passed into the traversal function. That turned out to be a nightmare though. Ended up doing something else.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group