o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

pointer to pointer -

Hello,

VS 2008 compiled in C.

I am working on pointer to pointers. I know that a pointer is a variable that has a value that is an address. But I am getting confused with pointers to pointers in C.

I have a program that I have modified to try and understand this concept.

Is the parameter **source the address of the actual pointer?

What is the real purpose of having pointers to pointers? I have seen them alot by looking at source code, but not completely sure why someone would want to use one. What would an alternative be in using pointer to pointers in C programming?

Many thanks,

Code:
void find_integer(int **source)
{
    // int *pint = &INTEGER;

	printf("***************************\n");

    printf("*source = %d\n", *source);
	printf("**source = %d\n", **source);
	printf("Address of &*source %p\n", &*source);
	printf("Address of &source %p\n", &source);
	printf("Value pointed to *source %d\n", *source);
	//printf("Value pointed to **source %d\n", **source);
	printf("*************************\n\n");
    
	*source = &INTEGER;

    printf("*source = %p\n", *source);
    printf("**source = %d\n", **source);
}

int main()
{
    int *pint = &INTEGER;
    double *preal = NULL;
    int a = 3, b = 5;

	printf("Address of Integer %p\n", &INTEGER);
	printf("Address of pint %p\n\n", &pint);

    find_integer(&pint);
    return 0;
}

 

[3.0/LINQ] Pointer to pointer to struct. -
Hey. I need to pass a pointer to a pointer to a struct from C# to a function in a C++ dll. I've tried numerous ways but it just wont work. So...how do I retrieve the pointer to pointer to struct in C#?


How do I cast a memory pointer to a UDT -
Hi everyone, I have a pointer which i got from a dll. This pointer is a memory pointer (.net IntPtr to be exact). which points to a user defined structure. I got this IntPtr by using the Marshal.StructureToPtr function in vb.net. After receiving this pointer in vb6 from vb.net, how


Deallocation -
what's wrong with this code? CMyClass *pointer = (CMyClass*)SomeThing ...do stuff with pointer // Done with pointer delete[] pointer i get a memory leak without deleting it and i get an access violation with it any ideas?


Mouse Pointer Changes -
Is their any way to monitor what happens to a mouse pointer while it is in another program eg. could the changes in a mouse pointer while a user is working in word be collected and stored in another app so a history of their pointer is available


Pointer declaration and initialization -
Hi, I'm wondering what actually happens when you declare a pointer and initialize it on the same line. Does it set the pointer's value or the value the pointer points to? Which of the following is correct? int *a = 1; or int *b = malloc(4); Thanks, Cedric


Hide/Disable Mouse Pointer -
I'm using a touch screen program and when it's launched the mouse pointer remains on the screen. What I'd like to do is either: - 1) Hide the mouse pointer when the application is running or 2) Make the mouse pointer so small that it's gives the impression that it's not the


[2005] Calling a pointer -
I have a vc++ 6.0 dll that is from a 3rd party (i.e. I don't have the source). One of the functions I need to call in the dll is not exported, but I get a pointer to instead. It's got 6 parameters of varying types. How do I call this pointer from vb? The CallWindowProc trick won'


could u please give an example How to use a far pointer in C -
Hi All, This is regarding to far pointer in C.Could u please provide ma an example for a far pointer decleration, and how to use it. Thanks: regards: raghunadhs.v


confused about IntPtr [resolved] -
Hello, I've been using VB.NET (2003) for a while now, part time, and I know I should know exactly what an IntPtr is, but I don't. Everywhere I look, there seems to be a different explanation. I know what an integer is. I know what a pointer is, in the simple sense of the word. Wha


Some help with pointer... -
Hi! Im using a pointer to plot pixels to a picturebox but i've got 2 problems with this... 1. ifi add + 1 to the colors, it adds more with pointers than with setpixel....(it gets brighter) 2. if i use setpixel, then i cant use the pointer anymore...


pointer tool -
I want to create a pointer tool like webex (pls go webex.com create meeting so on) like to draw line on pointer tool when mouse up all the draws to goes picture box and pointer tool come up its own original size. Its like movable, transparent and colored. If u have any idea and sourc


Pointer ** <- What is this -
I was just looking across some code and came across this: const char *p1; char **p2; What the heck is p2? p1 is a pointer to a constant. Is p2 some type of pointer? Thx, Tim


Getting STRUCTURE info from a pointer -
i am subclassing, and the lParam ends up returning a pointer to a structure of type MDICREATESTRUCTURE.. i want to know how i can access data in this structure when all i have is a pointer??? any ideas? thanks jeffrey


simple mouse pointer question -
i want to change the mouse pointer to the hand with a index finger but I cant figure out what that style is called in vb 6? I ave tried all the mouse pointer styles I can find in vb 6 except custom and none of them were the right one


creating a dangling pointer -
I need to test something out with a dangling pointer, iknow in theory how to create one(i think), the problem is mostly syntax... what i need is not something that causes a hard crash but, lets say, a function where something is computed but over time the result may be incorrect due to


Hi i need some helping telling a pointer to get a varible from a differnt process -
Hi i am hacking Battlefield 2142 to give myself unlimited ammo and i need some help.Ok so the way i am going to do this is get the address of a "pointer" that sends me to the variable for Clip size. I am programing this in Visual Basic 6.0 and i need some help coding it. So f


C++ Function pointer -
I have class thats called game. In the class theres a pointer called m_pDisplay. Its a pointer to a function in the class game. Then another class, CWindow, has a pointer to a game class. In the window class, how do i call the pointer in the game class? I thought something like... m


Making pointer of a long variable for another variable -
My brains are having issues, so here we go:I have a Long variable that I want to contain a pointer value. I want to change the value of this variable to be pointer value to anywhere in the memory. The value of another Long variable should change to be the contents of the pointer. I jus


Need to get around some pointers -
I have a template class that implements a PriorityQueue, the important thing about the PQ is that it requires the < operator and the == operator of the typename that I give it. So it works great with ints, PriorityQueue<int> is great. But if I use PriorityQueue<int*>


Retrieving data from a pointer -
how can I retrieve some data that contains a string from a pointer ? I'm using win api in vb , the function returns (long) actually a pointer to some text , how can I get the text in vb ? thanks


Cost of a function pointer -
I figured to save some time I would simply use a function pointer - pointing to the loop i need at the time. Ie.) gameloop, menu, credits, options, etc Does calling a function pointer cause any slow downs? anything I should know about?


What am I pointing too -
I'm doing a set of dlls for use with VB, some of them return a pointer to a class so the VB user can refer to it later. The trouble is if the VB user doesn't pass in the right number or passes in a pointer to a class that's already destroyed the whole thing just crashes. Is there


File Pointer -
Hi all I know its possible to move the file pointer around in C++, but is there a file pointer in VB? What I would like to do is write to a file, leave it open then read what I just put into it. Is there a way to move the file pointer (if there is one) to the beginning of the file a


pointer newbie question -
Hello, I am new to C#, and I came across a tutorial about pointer: int *x ; Declares a pointer variable x, which can hold the address of an int type. The reference operator (&) can be used to get the memory address of a variable. int x = 100; The &x gives the m


ASPX Button Pointer Issue -
Is it possible to have the mouse pointer change to some other pointer other then the arrow? I tried using the style cursor for the td the button resides in but it didnt work. It only works when the button is disabled. Any ideas? Thanks


How to make a backward/forward linklist -
How to I make a linklist that has a backward reference and a foward reference? Kind of like what the picture shows. Example: There are four records Record 1 has a back-pointer of 0 meaning it is the first record in the list Record 1 has a foward-pointer to record 2 Record 2 h


Pointer to array -
Ok, I've done lots of searching for this and it should be a good one. If I have a pointer to an array how do I "dereference it" if that is the right term to use it directly instead of thru a pointer? I have a struct that contains a pointer to an array. The array is populat


Where's the hand, man -
I wanted my pointer icon to switch to a hand over a picture box in VB6, but there was no option for hand, so it seems I'll have to plug it in as a custom. One problem, I can't find the hand pointer on my system because I don't know the extension for pointers. I'm also wondering if ev


Follow Mouse Pointer -
Hello, Is there a way that image follow mouse pointer whenever I move my pointer around form like in flash Best Regards


Changing Mouse Pointer on Click until MouseUp -
I'm using a picturebox as a custom button and I want to change the mouse pointer while the mouse is down. MouseMove is great, unless the user moves their cursor off of the control. I want the mouse pointer to be changed no matter where they move... until they release the button.


Using string pointer to get a string -
I am using SendMessage/PostMessage to send a string to a window. Now, as is the case, the window gets a pointer to the string. How do I convert this pointer into a VB string? I reckon I need to use StrPtr/CopyMemory, but I not not clear how to use it. Any code will be highly welcome.


array pointer -
Hy guys here is the problem........ I have an array of type byte. Using varptrarray function i got a pointer to that array. I have another function say writefile with parametes as imagepointer as long. I am passing this pointer to this function writefile. In the function writ


Change mouse pointer -
How do i change the mouse pointer into a custom mouse pointer for the document, meaning that instead of an arrrow i use my custom picture and when its over a link etc, then it defaults to a hand or whatever? Thankd in advnce DocZaf {;-> Boy i wasted hours on this and still


Display hour glass mouse pointer,during Files getting Copied -
i'm using VB.NET. when a button is clicked the utility will display an hour glass mouse pointer, and it will begin copying the Utility settings from one computer to another computer on the network. Upon completion of these steps, the mouse pointer will return to it’s default style


What is actualy a pointer.... -
At school they though us it is just a "storage room" for an adress. But if it was only that, why do we den have diffrent types of pointers. Like a pointer to an object from class A and an other one that points to an object from Class B. And pointer that points at A, can't be


Pointer math / images -
I need to find a pointer increment that when used repeatedly, describes a line of pixels running through an image at any angle. To start with all I have is the starting and ending points of the line as (u,v) texture coordinates... Look at the image and you see that the start and


Geting Pointer -
Hy guys, If somebody can tell me how to get a pointer to the temperory buffer used by the open statement. thank you anis


Passing Pointer to EXE -
Hi, I need to find a way to pass a pointer as a paramter to EXE file. Is command line sutiable? Thanks for any help,


how to check if a pointer is pointing to something -
how should i do it? i tried with if (pointer == 0) but it later raises some errors :|


How to return the x y of mouse pointer (RESOLVED) -
I wish for a form i have to apear beside the mouse pointer, how can i return the x y values of the mouse pointer?