Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C++ Memory Reclamation and SQLHSTMT

Posted on 2011-02-18
2
Medium Priority
?
794 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

721 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