473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

delete problem

GG
Hello.

I have structure :

typedef struct SBlog {
long id_blog;

char bl_name[64];

char bl_domain[64];

} SBLOG, *PBLOG;

I made table:

BLOG pBlog = new SBlog[10]

When I try free memory :

delete [] pBlog

I get error :

Debug Assertion Failed !!!.

What I do wrong ???

Thanks for your help

GG




Jul 23 '05 #1
3 1111
"GG" <Gs@df.pl> wrote in message
news:d1**********@nemesis.news.tpi.pl...
Hello. Hi. I have structure :

typedef struct SBlog {
long id_blog;

char bl_name[64];

char bl_domain[64];

} SBLOG, *PBLOG;

I made table:

BLOG pBlog = new SBlog[10]

When I try free memory :

delete [] pBlog

I get error :

Debug Assertion Failed !!!.

What I do wrong ???

Something other than what you have shown.
Most likely, some errant code has altered
the data structures used by the heap manager
such that they no longer conform to its design.
Maybe you overwrote past the end of one or
more of the arrays in your table.

--
--Larry Brasfield
email: do***********************@hotmail.com
Above views may belong only to me.
Jul 23 '05 #2
> typedef struct SBlog {
long id_blog;

char bl_name[64];

char bl_domain[64];

} SBLOG, *PBLOG;

I made table:

BLOG pBlog = new SBlog[10]

When I try free memory :

delete [] pBlog
...
What I do wrong ???


The code you have shown can not compile, so you are actually getting the
error message from some other code. Please show the smallest amount of code
that can compile and produce the problem.

Niels Dybdahl
Jul 23 '05 #3

"GG" <Gs@df.pl> wrote in message news:d1**********@nemesis.news.tpi.pl...
Hello.

I have structure :

typedef struct SBlog {
long id_blog;

char bl_name[64];

char bl_domain[64];

} SBLOG, *PBLOG;

There's no reason in C++ to use this old C style of definition. You can
simply do it like this:

struct BLOG
{
// members here
};

I made table:

BLOG pBlog = new SBlog[10]
What's a "BLOG"? You haven't defined that type anywhere in the code you've
shown. Apparently, it's some kind of pointer, since you're using new with
it.

When I try free memory :

delete [] pBlog

I get error :

Debug Assertion Failed !!!.

What I do wrong ???


Something other than what you've shown is wrong, unless BLOG is a valid
pointer type defined elsewhere, and you're using it wrong by assigning it
the results of "new SBlog[10]".

-Howard
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jonan | last post by:
Hello, For several reasons I want to replace the built-in memory management with some custom built. The mem management itlsef is not subject to my question - it's ok to the point that I have...
2
by: Cornelius Buschka | last post by:
Hi, we saw the following problem: We deleted all rows from a table B referencing table A (~500000 records). No problem, but the following try to delete all records from table A (~180000) lead...
3
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
2
by: Bob Tinsman | last post by:
This problem shows up in Firefox 1.5.0.1 and Rhino 1.6R2. I've found that if I have an XML node expression that ends in a filter, I can't use it with the delete operator. In the following...
6
by: radishcarrot | last post by:
Hi, I am rather new to C++ and an invalid exception has occurs in my system which I have absolutely no idea as to why it happens. Please help! Thank you. I have created a method which takes in...
6
by: Lighter | last post by:
Big Problem! How to overload operator delete? According to C++ standard, "A deallocation function can have more than one parameter."(see 3.7.3.2); however, I don't know how to use an overloaded...
5
by: rn5a | last post by:
The .NET 2.0 documentation states the following: When using a DataSet or DataTable in conjunction with a DataAdapter & a relational data source, use the Delete method of the DataRow to remove...
9
by: rohits123 | last post by:
I have an overload delete operator as below ////////////////////////////////// void operator delete(void* mem,int head_type) { mmHead local_Head = CPRMemory::GetMemoryHead(head_type);...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
On a form - I have a datagridview which is docked to the entire form. The datagridview allows users to Delete and/or Add Rows. On the Form_Load event I Fill the datagridview source table with a...
11
by: Ed Dror | last post by:
Hi there, I'm using ASP.NET 2.0 and SQL Server 2005 with VS 2005 Pro. I have a Price page (my website require login) with GridView with the following columns PriceID, Amount, Approved,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.