Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Turbo C++ Container Classes

Posted on 1997-02-18
1
Medium Priority
?
667 Views
Last Modified: 2013-12-27
I seem to be having a little bit of trouble using the container class TListImp provided by Turbo C++. I have created my own typedef ListImp as an integer version of this template and I am using it in the implementation of a graph ADT. However, when I try to use the Detach member function of this class I create a general protection fault in the processor. Has anyone used this template and if so could they please offer any advice or maybe even produce a peice of example code which I may find useful?
0
Comment
Question by:Gabriel021197
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
edtmihu earned 100 total points
ID: 1598452
I don't TC. But this works with BC5.01:
#include <classlib\listimp.h>

class MyInteger
{
public:
      MyInteger() : i( 0 ) {;}
  MyInteger( int _i ) : i( _i ) {;}
  virtual ~MyInteger(){;}
      int operator == ( const MyInteger _FAR& test1 ) const { return( test1.i == i ); }
private:
      int i;
};

typedef TListImp<MyInteger> MyIntegerList;

#pragma argsused
int WINAPI WinMain(
    HINSTANCE  hInstance,      // handle of current instance
    HINSTANCE  hPrevInstance,      // handle of previous instance
    LPSTR  lpszCmdLine,      // pointer to command line
    int  nCmdShow       // show state of window
   )
{
      MyIntegerList list;
  int i;
  for ( i = 0; i < 1000; i++ )
        {
        list.Add( MyInteger( i ) );
    }
  for ( i = 0; i < 1000; i+=2 )
        {
        list.Detach( MyInteger( i ) );
    }
  return( 0 );
}

Regards Michael
0

Featured Post

Enhanced Intelligibility Without Cable Clutter

Challenge: The ESA office in Brussels wanted a reliable audio conference system for video conferences. Their requirement - No participant must be left out from the conference and the audio quality must not be compromised.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question