Can I do something like that? The compiler gave an error if I do this. I tried with:

struct01->file = (File*)file;

and it works. Do I have to cast it to make it work?

Thanks

09-08-2002

Dr. Bebop

This is a really tricky and subtle problem involving the const qualifier. Put simply, in the context of pointers, you can't assign a const pointer to a non const pointer without a cast but you can assign a non const pointer to a const pointer. The C++ standard explains it in the usual cryptic way, but this is pretty much what it boils down to.