Solved

C++ Memory Reclamation and SQLHSTMT

Posted on 2011-02-18
2
792 Views
Last Modified: 2012-05-11

In my snippet. Is it necessary to delete or initialize the member variable, m_hstmt?
		CString m_SQLString;
		CString m_WhereClause;
		short m_nFields;		// The number of fields in this rowset
		SQLHSTMT	m_hstmt;		// Statement Handle

Open in new window

0
Comment
Question by:TimPeer
[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
2 Comments
 
LVL 4

Accepted Solution

by:
HawyLem earned 500 total points
ID: 34931906
I think not, as you can see:
typedef SQLHANDLE               SQLHSTMT;
typedef void *                          SQLHANDLE; 

Open in new window


it's a void pointer. So no memory disallocation needed. Initialization as any other pointer
0
 

Author Closing Comment

by:TimPeer
ID: 34931915
Excuse my lack of knowledge with void *, what makes them unique that one needn't deallocate if they are allocated? Is the ponter created on the stack and released when complete or...

You get the points, but would appreciate the followup question.

Many thanks!
Tim
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

623 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