Something about pointers

Could anybody help on the ** pointers. I have something like this:
typedef struct MyStructure{
In fact, If anybody could explain to me how this struct works,it be'll great.
Who is Participating?
MT_MUConnect With a Mentor Commented:
For the sake of illustration - assume XXX is actually char.

If we were to assume that that BBB is appropriately initialized.  *BBB would point to the addess of a string.

**BBB would point to the first character of the string pointed to by *BBB.

And for example....

char *Str1 = "1String";
char *Str2 = "2String";
char *Str3 = "3String";

MyStructure xyz;

xyz.BBB = (char **)malloc(sizeof(char *) * 3);
// Fill in our array

xyz.BBB[0] = Str1;      // This is the equivalant of *xyz.BBB = Str1;
xyz.BBB[1] = Str2;
xyz.BBB[2] = Str3;

// Loop through the strings...

char **strptr = xyz.BBB;

for (int i = 0; i < 3; i++)
  char* onestring = *strptr++;

a pointer is a variables that contains an address. at that address is a value of the type XXX in your case.

now, if you have a double pointer, it means that the variable points to a place in memory where a pointer to XXX (or YYY) resides.

so you have

BBB of type XXX** points to -> a type XXX* that points to -> a value of type XXX

hope it's clear enough
asmaAuthor Commented:
I'm new to pointers & structures. In fact, my C knowledge are basic ones.If it get complicated, i'll be lost. Is there a good C bible out there that teaches you all these jargon?
Live webcast with Pinal Dave

Pinal Dave will teach you tricks to help identify the real root cause of database problems rather than red herrings. Attendees will learn scripts that they can use in their environment to immediately figure out their performance Blame Shifters and fix them quickly.

I kind of hate to admit this - but it's been so long since I started programming that I've forgotten what books seemed to help.  

I'll take a look and see if I still have some.

Asma,write your EMail and i 'll send you pointer tutorial.
asmaAuthor Commented:
My email is

You could try this book:
This is a wonderful book, especially if you want to do self-study.

The C Programming Language: ANSI C Version
Brian W. Kernighan  Dennis M. Ritchie

Paperback, 2nd ed., 272pp.
ISBN: 0131103628
Publisher: Prentice Hall
Pub. Date: May  1988
Price is about $40 to $60, depending on the binding and edition.

- stochastic

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.