Solved

C++ Memory Reclamation and SQLHSTMT

Posted on 2011-02-18
2
778 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now