The other day, I got an idea for a compression program, and decided to write up a function that compresses a file into "filename.compressed". Compression function works fine, but I get a nasty assertion failure at the return of the main() function, after the file's been compressed. Assertion failure is on line 1017 of dbgheap.c, the expression being asserted is _BLOCK_TYPE_IS_VALID_(pHead->nBlockUse). Here's my code: [code] #include <stdio.h> #include <malloc.h> #include <string.h> #include <deque> using namespace std; void addstrings(char **first,char *second) { int size = strlen(*first)+strlen(second); char *temp = new char[size+1]; strcpy(temp,*first); strcpy(temp+strlen(*first),second); delete [] *first; *first=temp; } int compress(char *file,int …

Member Avatar
Member Avatar
+0 forum 2

(edit) Code was too long for forum. I'm splitting it in 1/2 I'm currently working on a Direct3D class that simplifies D3D, so I can use it to make games, applications, etc. I started on it yesterday, got it to work so it draw triangles with a different color on each vertex, and made a function that draws 2 triangles to make a quadrilateral(or at least something with 4 vertexes). Now, before I started on making textures for the triangles/quads, I put better error handling in. Everything seemed fine. So I went and started a few changes, so I could …

Member Avatar
Member Avatar
+0 forum 2

The End.