Re: Simple question on Pointers



"Alan Carre" <alan@xxxxxxxxxxxxxxxxx> wrote in message
news:uUZGtIoUJHA.1160@xxxxxxxxxxxxxxxxxxxx
Can't declare a list of pointers either without using typedef hacks.

#include <list>

std::list<int*> list_of_pointers;

Or did you mean an array of pointers?

int* array_of_pointers[12];

Nary a typedef in sight.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: structures, structures and more structures (questions about nested structures)
    ... >>>typedef union { ... How do I calculate the size of the structure MotherStruct ... of all members, including pointers. ... How can sizeof know how much memory you have allocated for the char* ...
    (comp.lang.c)
  • Re: Question about a struct declaration
    ... typedef struct dummy *dummy; ... If want to use the type as a pointer, then hiding the fact that it is a pointer in a typedef is indeed a pretty useless idea. ... A classic example would be the interface of 'pthreads' library, where 'pthread_t', 'pthread_mutex_t' etc. might easily be pointers. ... work in case when you need to self-refer to the struct type from inside ...
    (comp.lang.c)
  • Re: MEX: using malloc with C++ in C wrapper, error conversion from void to myType
    ... Somehow I was thinking of pointers as being just pointers, with an otherwise nebulous definition, but yes, pointers are variables containing an address. ... Microvolt is a double, fyi. CTypes.h contains: ... typedef double Hertz; ... itmp = mxMalloc); ...
    (comp.soft-sys.matlab)
  • Re: #includes
    ... so your not chasing your tail?? ... OTOH, if you have pointers instead, then you break the paradox. ... With sufficient thrust, pigs fly just fine. ...
    (microsoft.public.vc.language)
  • Re: Function Pointers
    ... If you feel the need for a generic pointer-to-function type, ... should probably create a typedef for it. ... Others have shown you how to typedef a function pointer type. ... I also prefer to see the "pointerlyness" of pointers, ...
    (comp.lang.c)