Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A Pointer to pointers? 1

Status
Not open for further replies.

Valius

Programmer
Oct 20, 2000
174
US
This is what I have....

CAsyncSocket *MySocket = new CAsyncSocket[10];

MySocket[0].Create();

I want to access it this way...

MySocket[0]->Create();

How can I declare a pointer to a pointer? Does this make sense?

Thanks in advance!

Niky Williams
NTS Marketing
Niky.Williams@NTSMarketing.com
 
I believe that you are already having a pointer to a pointer in you declaration. This is because an array declaration is a pointer to the first element of that array.
So you already have a pointer to a pointer, or do you want a pointer to a pointer to a pointer. You can have a infinite number of this chain, but the question is: Is it really worth it. The maximum chain I saw was three and only once, but I don't remember the context.

Long live Godess Athena
dArktEmplAr of Delphi.
 
you wouldnt be doing a pointer to a point, to a point, and so forth

you would be having a Pointer to a memory location for each pointer.

the only difference is, that each new pointer would have gotten it's memory location from the newest pointer.

or do you mean a pointer pointing to the actual object varible of a pointer (in otherwords, not to copy its memory address, but to treat the pointer as if it were a variable)

Am I the only one thats about to go insane ! hehe

If you look at it from my point of view, you should not treat pointers like they are physical variables, I myself would only treat them like memory locators, or a "View" of the variable's memory location. Kinda of see where I'm getting, I visualize a pointer as not holding data, but rather just linking/pointing to a memory address, so I cannot see myself doing a "pointer of a pointer" because it would give it that variable characteristic.


Just to explain why i'm having troble seeing what or why you are trying to do this. Karl Blessing aka kb244{fastHACK}
kblogo.jpg
 
Just curious if it would be easier or not....I guess not. Yes, I do look at pointers as "pointing" to mem locations and not like an actual holder of info. One reason why I like pointers is that they are so versatile. Thanks for all your comments (crazy or not) about this subject. Believe it or not, it did clear some things up...I've been known to be a little crazy myself....heck, I used to program screen savers in Turbo pascal in DOS just for fun...is that crazy or what? :)
 
not as crazy as me doing the same in Qbasic, Trubasic, and making small GUI and other artsy programs in the early DOS basics.

I mean my general path of languages:

ASM/BASIC on a Tandy Pocket Computer 6 (more like a Sci Calc)
Qbasic on 486/25SX
Pascal/Trubasic/VB For Dos (I tried three at the same time)
played with Borland C++ for Dos
VB3/VB4 (win3.1) Got pretty good with this
Borland Delphi 3 (this was rather fun, esp for pascal)
VB5 (Win95)
Borland C++ Builder (played a little)
Microsoft Visual C++ (non-GUI related)
Visual Basic 6 (one of my Current)
Visual InterDev (other current)

There are a few other languages, I've learned a bit of on my spare time, or just played with, most of vb, c++ and pascal, I learned just from playing with the compilers that I was handed or given (my neighbor was a devloper with VC++ and VB, earlier, Qbasic just happened to be on my PC)

The only class I ever took , was AP C++ in HS (called AP Computer Science), and that was just because I couldnt find enough solid reasources on the web a couple years back.

Now is that crazy or what (even at my job, I'm self-learning by kind of doing on-the-job, looking at former developers codes as well, reading all your fine posts now, and etc, etc man I need to goto college)

Ok that was a bit off topic, but I just wanted to show you how crazy it can be (I've known crazier people :) ) Karl Blessing aka kb244{fastHACK}
kblogo.jpg
 
How long have you been programming? I mean from your HS days? That's pretty much when I really started dabbling in it, went to a 4 year college and got my degree in CST(wasn't worth a penny of it) and now I'm here. I guess you can still call me a green horn, but I love soaking this stuff up.

Niky Williams
 
I started with the 486/25 SX at 13, I am 20 now, I graduated in '99 , after high school, I did a couple regular jobs, such as Blockbuster Videos, that kind of thing, while still keeping programming as a hobby.

then mid-late Summer of '99 , I took a summer job at NC State teaching programming, to the kids at the ACE Computer camp that was there (it was funny, because after that I could jokingly say I taught at NC State) , they hired me as a teacher, saying I knew enough, even tho I didnt meet the 1 year college requirement that teachers for the class would require.

then after that I hooked a job up with my current employer, been with them ever since, just basically using every tool of visual studio they had (except for visual FoxPro, but thats about it)

I mean my information should be on my site, but if you wana know more, just email me, so that I dont flood this thread up with information that would seem , "solicited" you know. Karl Blessing aka kb244{fastHACK}
kblogo.jpg
 
A suggestion is to move to the next phase of computer programming instead of learning many languages!

Phase 1. "Respectable" enterprise/database yada/yada/yada programmer.
Phase 2. Artificial Intelligence/ Games Programming/ "Real" Compiler programming
Phase 3. Heuristic Analysis/ Neural Network programming.

Phase 1 is where you don't really program, but use the tools written by others in Phase 2 and 3 to connect parts of code and then sell it as a solution.
Don't learn many languages, but be a master in one and get the concepts correct. If you reach Phase two it is great.

Welcome to the Pythian Games!
Long live Godess Athena!
dArktEmplAr of Delphi Oracle
 
I may be Phase 1, with VB and Visual Interdev, which is what the focus of my job is, if I wasnt already writing new code, I wouldnt even be holding this job.

Dont assume that I dont know how to code for myself (the only thing that I looked at that, were old, were projects thats been around for a couple years, and I Fixed those, put new things in)

my title is Programmer/Analyst.

Just because my level of coding, isnt as deep for game programming and such, I like the type of Programming right now, Web Development is a very big field.

Also I once knew a friend who was a game programmer, he says it's the most boring type of programming in the world (he was the one that does the real deep codes) , but heck the end results were so good you could be proud of them.

Also I am not trying to continue to learn more, Once I feel quite good with VB and Interdev ( which I feel good with already but I know there is more I Can learn in VB ) , I plan to tackle C++ straight on.

So Right now I'm only reall concentrated on two major languages, VB and InterDev(ASP, HTML, Blah blah)

both of which are pretty intermigled (because vbscript is used in ASP) Karl Blessing aka kb244{fastHACK}
kblogo.jpg
 
Is it good?
CAsyncSocket **MySocket = new CAsyncSocket*[10];
John Fill
1c.bmp


ivfmd@mail.md
 
Sorry, I didn't want to hurt your feelings. The statements that were written by me are just an introspection of myself and this is just a suggestion for others to look into or throw it out of the freaking window!
It is great to know that you are an Analyst/Programmer at the age of twenty, good work!
BTW I still think that concepts are what you should work on and not languages: e.g: I think that in Web programming there is only one concept: Request and Response. This can be done in any language i.e. not only in ASP, JSP but also in C++, Delphi etc.
The same thing applies to middleware programming. The concepts is the same, but you can use EJB or CORBA or COM/DCOM.
If you are interested in languages, try out Kylix from Borland Corp., it will expose you to linux also, but with the ease of VB, and you already worked in Delphi, so it is easy.
Live your Passion. If it is in Phase 1, great, as long as you love it. If you think what you are doing is work, then it is not your passion.

Sorry to hurt your feeling. I apologise.

Welcome to the Pythian Games!
Long live Godess Athena!
dArktEmplAr of Delphi Oracle
 
Web development is much much more than "Request/Response" (no offense) , also I do happen to have a pretty good deal of experience using Linux, and somewhat FreeBSD, I Also used to work as an Asst Technician fixing up Macs, and such at different schools.

Speaking of graphical, my favorite distribution of Linux is Mandrake 7.2 (and up) , Suse Pro 7 being my other. I Tried to learn some C++ in linux, but unfortunatly my knowledge was too cripled by the Dos-Dependant headers, and learning True Standard C++ , was going to go out of the way for my current time schedule.

But just to clear things up.
My main task is Web Development
but that means, I have to:

Create ActiveX Componets and dll in VB or VC++
Know HTML, Javascript, Dhtml, and DOM
Know Serverside scripting (VBscript mostly)
Database programming
IIS and NT/Win2k Server administration
SQL knowledge (mostly embeded Queries, but I Can handle ent manager)
Hardware maintenance
Some Networking
Software Maintainance (OS support, so forth)

and whatever comes with the above. Unlike a traditional specialized job, I have my specialized skills, but also know other skills as well, if an administrator, of SQL Admin, or any of the above are not availible to suit my needs. ( I use win2k pro at home as my primary OS)

But thanks for the tip on Kylix, something definitly worth looking into.

(should we ask dave to move this thread (or sections of) to a more appropiate place?) Karl Blessing aka kb244{fastHACK}
kblogo.jpg
 
How can you REALLY program you own code unless you get down to ASM and Machine code itself? Can't you just define it as a varing level of complexity when dealing with programming? I mean, you have MFC....very high level of programming...you also have C, very low level right next to ASM. Then there are all the ones in the middle...and even some that are a higher level. So, when is the point where you can say that you have written your OWN code? Hasn't it already been done before? Just a little tid bit to ponder.

Niky Williams
 
Thanks JohnFill...I think this is what I was lookin for...just didn't know the context.

Niky Williams
 
In adition:
CAsyncSocket **MySocket = new CAsyncSocket*[10];
MySocket[0]=new new CAsyncSocket(...);
MySocket[1]=new new CAsyncSocket(...);
MySocket[2]=new new CAsyncSocket(...);
...
John Fill
1c.bmp


ivfmd@mail.md
 
I think what darktemplar (did I get that right?) , is trying to say , by spliting those catagories, he is basically pointing out the level of understanding (or concept) that would generally be required to know.

For example, Writing ASP page, if even rescursive, isnt enough understanding and concept, that would be required to write a low-level virtual device driver for the next generation video card.

There are some things in C++ that I Cant do in VB, because either the ability of the concept is not built in. (of course I belive that should change with VB7 somewhat)

It takes more understanding to design a 3d graphic engine , (like they did OpenGL and such) , to understand how it works, than it does to write standard business applications.

Also it depends, we all dont wana re-invent the wheel (not most the time anyways) but more efficient ways may be found. Karl Blessing aka kb244{fastHACK}
kblogo.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top