Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!agate!e260-4e.berkeley.edu!labc-2ic From: labc-2ic@e260-4e.berkeley.edu (Eric van Bezooijen) Newsgroups: comp.lang.c++ Subject: C++ beginner question Message-ID: <1991Jun13.041655.3930@agate.berkeley.edu> Date: 13 Jun 91 04:16:55 GMT References: <1991Jun11.183133.11458@auto-trol.com> <1991Jun12.171947.28079@iitmax.iit.edu> <1991Jun12.223310.6791@mercury.cair.du.edu> Sender: usenet@agate.berkeley.edu (USENET Administrator) Organization: University of California, Berkeley Lines: 26 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....