Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: What pointer are they talking about?  (Read 3426 times)

0 Members and 1 Guest are viewing this topic.

AmyR7

    Topic Starter


    Hopeful
  • Hi Everyone!!
  • Thanked: 1
    • Funtrivia
  • Experience: Familiar
  • OS: Windows XP
What pointer are they talking about?
« on: June 29, 2010, 10:09:25 PM »
I'm not sure what internal pointer they are talking about?
Is this pointer the symbols, brackets, etc.. that I see typed onto the page?
Here is what I'm talking about,
<?php

$fruits = array('apple', 'banana', 'cranberry');
echo end($fruits); // cranberry

?>

Yes, I know what an Array is.
That is not the problem. I also know what first and last means too. I've taken all the classes on calculus, Computers Concepts and Applications.
So, yes, Cranberry is the last item. So, yes, as you can see, I understand that.
apple is the first one, banana is the 2nd item.



I set the DVD/VCR to start recording and stop at a certain time all the time.
So, I know how to calculate things. Since I have to do that in order to have it stop about 7 minutes sometimes past when the show is due to end, in case of other things with the clock that maybe off a bit.




Also, sorry if I sound like I'm confused. I'm sick anyways all the time and just had Hepatitis A, and still dealing with affects from that which affects my memory and stress makes things worse too. I'm trying to get all the basic information about things in life all written down, so that in case I go into problems again where I don't even know how to spell my own name, I can look back at information for things.
So, yes, I've already learned all these topics years ago is what I'm trying to say, and got A's in the classes too. Which is why going out to take a class or something, which I can't physically do any of that due to my health being worse.

Thanks,
Amy










kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: What pointer are they talking about?
« Reply #1 on: June 30, 2010, 04:04:08 AM »
So what's the question?

The internal pointer is the item in the array which is currently being used.
See here: http://www.talkphp.com/vbarticles.php?do=article&articleid=41&title=using-the-internal-array-pointers-to-access-elements-in-arrays

AmyR7

    Topic Starter


    Hopeful
  • Hi Everyone!!
  • Thanked: 1
    • Funtrivia
  • Experience: Familiar
  • OS: Windows XP
Re: What pointer are they talking about?
« Reply #2 on: June 30, 2010, 11:14:23 AM »
Yes, so is the double slashes //
is that the internal pointer? Since Cranberry is typed there? Since it is being used.
Or is the internal pointer any of the quotes around the word Cranberry in the Array list above?
Or is it the parenthesees?



kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: What pointer are they talking about?
« Reply #3 on: June 30, 2010, 11:47:36 AM »
It's the item in the array. In your example the pointer is at cranberry.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: What pointer are they talking about?
« Reply #4 on: June 30, 2010, 11:54:09 AM »
You can't see the internal pointer.

as you said, you understand what an array is. good.

so you have the array of strings in $fruits:

Code: [Select]
$fruits = array('apple', 'banana', 'cranberry');

the Internal "pointer" is basically part of the array. you can't see it- you don't define it when you create the array- by default it "points" to the first element.

Various array functions change the "current" element being pointed at in the array. For example, the end() function you use:


Code: [Select]
$fruits = array('apple', 'banana', 'cranberry');
echo end($fruits);

as you note in the comment, it will give back "cranberry" since that is at the end of the array.

however, it also sets the "current" element (the internal pointer) to point at the last element of the array. if you tried to use the next() function on the fruits array, you wouldn't get anything in return:

Code: [Select]
$fruits = array('apple', 'banana', 'cranberry');
echo end($fruits);
echo next($fruits);
would only echo "cranberry"; the second "next" function returns nothing- since the next() function returns the next item, and the internal pointer is at the end of the array already, there is no next item.





I was trying to dereference Null Pointers before it was cool.

AmyR7

    Topic Starter


    Hopeful
  • Hi Everyone!!
  • Thanked: 1
    • Funtrivia
  • Experience: Familiar
  • OS: Windows XP
Re: What pointer are they talking about?
« Reply #5 on: June 30, 2010, 02:08:15 PM »
You can't see the internal pointer.
the Internal "pointer" is basically part of the array. you can't see it- you don't define it when you create the array- by default it "points" to the first element.

Too bad I can't see the Internal pointer  :'(
I was hoping maybe I found something that might help to figure out what the guy who messed up all my files and stuff did.
Since the index file is suppose to be the default. The 1st that happens by default. See, I know he renamed the files, even when I tried to tell him not to do this. He was trying to help me back things up. Which the other thing is I keep trying to ask him, if renaming the files is what is suppose to happen, why did it work just fine for me when I backed things up without renaming the files. I can't get him to answer this question.
He has messed both mine and my mom's computers, accounts we have all messed up due to this.
Here is one of the messages that happens when we try to open the files,
"
Firefox can't find the file at
/C:/DOCUME~1/Anne/LOCALS~1/Temp/Temporary Directory 7 for
amy.zip/abctvshows/abctvshows/geocities.com/abctvshows/ben3.jpg.

Could the item have been renamed, removed, or relocated?
Is there a spelling, capitalization, or other typographical error in the address?
Do you have sufficient access permissions to the requested item?
"

So, maybe we are already at the end of somewhere, and it can't get to the next item, since there is no next item. Unless since the index file is the 1st one and if it's been erased, then the 1st item is not there, so the next item can't work right and it's messing things up because of this. Since that 1st item needs to be there for things to execute/work properly.







kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: What pointer are they talking about?
« Reply #6 on: June 30, 2010, 02:31:19 PM »
What has that got to do with PHP arrays?

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: What pointer are they talking about?
« Reply #7 on: June 30, 2010, 06:34:49 PM »
Too bad I can't see the Internal pointer  :'(
I was hoping maybe I found something that might help to figure out what the guy who messed up all my files and stuff did.
What you posted was a segment of PHP code. it has absolutely 0 to do with anything that anybody would have done on your PC at any point in time.


Quote
Since the index file is suppose to be the default.

I'll take your word for that I suppose. although I'm not sure when rules about PHP arrays became applicable to files.  ???

Quote
The 1st that happens by default.
right (?)

Quote
See, I know he renamed the files

you do? did you watch him rename the files or do you have psychic powers, or what made you "know" this?


Quote
He was trying to help me back things up. Which the other thing is I keep trying to ask him, if renaming the files is what is suppose to happen, why did it work just fine for me when I backed things up without renaming the files. I can't get him to answer this question.

No idea what your talking about now really.

Quote
So, maybe we are already at the end of somewhere, and it can't get to the next item, since there is no next item. Unless since the index file is the 1st one and if it's been erased, then the 1st item is not there, so the next item can't work right and it's messing things up because of this. Since that 1st item needs to be there for things to execute/work properly.

the end of somewhere? next item? index file? you asked about PHP arrays because you gave a segment of PHP. that has absolutely nothing to do with files or indexes or your local machine whatsoever, and certainly it has zero relevance to what you claim to be a vigilante "repairman" going around renaming peoples files.
I was trying to dereference Null Pointers before it was cool.

AmyR7

    Topic Starter


    Hopeful
  • Hi Everyone!!
  • Thanked: 1
    • Funtrivia
  • Experience: Familiar
  • OS: Windows XP
Re: What pointer are they talking about?
« Reply #8 on: July 01, 2010, 04:45:51 PM »
What you posted was a segment of PHP code. it has absolutely 0 to do with anything that anybody would have done on your PC at any point in time.
Some of the files he was messing with have the .php extensions.
Quote
I'll take your word for that I suppose. although I'm not sure when rules about PHP arrays became applicable to files.  ???
right (?)
Since I know for each events/functions to be able to happen, if the 1st thing, or the default is not there anymore, the whole thing is not there anymore. Then nothing can start because it is looking for things that are not there anymore.
Quote
you do? did you watch him rename the files or do you have psychic powers, or what made you "know" this?
Because this is what he told me he was going to do before he did this. He said he is going to rename them. Which I didn't want him to do. I tried so many ways to just stop him from doing this. He wouldn't listen and did it anyways.




Quote
the end of somewhere? next item? index file? you asked about PHP arrays because you gave a segment of PHP. that has absolutely nothing to do with files or indexes or your local machine whatsoever, and certainly it has zero relevance to what you claim to be a vigilante "repairman" going around renaming peoples files.

We have a terrible time when trying to get tech support for anything. A lot of what some of them say don't make any sense either. Like when you call because the new DVD/VCR combo recorder keeps stopping and then telling you it is illegal to record the tv show you are trying to record. We know it's not illegal for several reasons, the biggest reason we know it is not illegal is when you have another one that is currently doing that function just fine and the one you are replacing did all these things just fine before the whole thing just died because of having it for years, since we know all things in life don't function anymore after a certain amount of time.


Also, not sure why you say that the PHP Arrays have nothing to do with files on my computer. Since the information listed in the arrays are typed out there. That is what you type in the list. Yes, I used the software that is installed on my computer to type it out. The software is installed in the Add remove programs section of the whole computer. So, whenever you want to use that Program/software, whatever you want to call it, you just select what you want to use and use it. You type the words, by hitting the letters on the keyboard. Then you hit file and save as, and it saves the file. All of the files have extensions. Some of those extensions are .php
.html .css .jpg .gif and so on.
Plus there are things typed before the extension. The word index is what is typed there for all the index files.
index.html
index.css
index.php
index.dat
Also, all of the files are of course in folders. The folders you create and name the folder to put them in.