[comp.lang.c++] C++ beginner question

labc-2ic@e260-4e.berkeley.edu (Eric van Bezooijen) (06/13/91)

Help me!  I am attempting to program Windows 3.0 on a 486, using C++/Views
and Borland C++.  I just started to use C++/Windows/IBM PC (It's that bad),
and I have been struggling ALL day with the following problem :

I have an object called repository.  This object contains a structure called
repo_repo.  What I want to do, is to access this structure.  I initialize
this structure in the constructor, and I call a procedure in this object
from another object, and this procedure accesses the data structure.  Now
here is my problem :

When I try to access this data structure, the program crashes.  This is the
data structure :

	struct repo_structx {
	int sug;
} *repo_repo;

I access the data structure in the constructor.  It does not crash there..
However, as soon as I try to access it anywhere else, the program crashes.
I of course, have malloced space for it.  Why can't I access this pointer?
I have tried everything to make it work.  I have tried creating a special
class instead of this struct, I have tried using structs instead of pointers
to them , and I have tried making everything static.  However, nothing would 
link then....