GDICommander 54 Posting Whiz in Training

Put all the code for input into a do-while loop.

For example:

do
{
        //Input...
}
while (//The variables have their correct value);
GDICommander 54 Posting Whiz in Training

Hello everyone.

I am using ACE and I'm using the following method:

ACE_OS::read(char* buffer, int nbbytes, int perms);

I was informed that Windows is reading data from disk sectors and it puts the contents of the read sectors into the cache (who is in memory). I don't want that behavior (putting sector contents in the cache in memory), so I want to inform ACE.

My question: how do I inform ACE of it? I haven't found a special permission for it.

GDICommander 54 Posting Whiz in Training

It's easy to do with a command-line interface. You can emulate a console interface and navigate through your file system. It is easy to implement "ls" with iostream of fstream.

You will have plenty of fun to do it.

GDICommander 54 Posting Whiz in Training

You need to put "new Venn()" in your constructor or after the declaration of forstevenn, and make sure that the String object to print is initialized (via new).

GDICommander 54 Posting Whiz in Training

By the way, try indenting your code like this:

int main()
{
}

or

int main(){
}

It is more easily readable.

GDICommander 54 Posting Whiz in Training

I don't see brackets surronding the parralelIterative function. If this explains the error, it will be good. Also, a semi-colon after the parralelIterative line is not correct.

GDICommander 54 Posting Whiz in Training

Two possibilities here:
-the String of Venn is null.
-p is null and that is why the message is not printed.

Use System.out.println("Debug messages") to trace the execution of the code. This will help.

GDICommander 54 Posting Whiz in Training

That error generally means that at some point your program wrote to a location outside the array's allocated memory. You see the error at the delete statement because the VS debugger gives these warnings at program exit.

Check your array access carefully for any out of bounds writing.

You were right. I checked the values of the array after the sort and I found a weird value (-3 billion ...). I used the provided heapsort in a wrong way.

Thanks for the help!

GDICommander 54 Posting Whiz in Training

Hi, everyone.

I am doing a performance test on the heapsort. I wrote this program and it has a run-time error that I cannot explain. I am compiling on Microsoft Visual Studio 2008 and this is the error.

HEAP CORRUPTION DETECTED after Normal Block ... well, I think that the details are not necessary for the rest of the problem.

This is the problem. I am allocating a dynamic array (int* a = new int). I am passing it to the heapsort (Heapsort(A, size)). This is the signature of this function:

void Heapsort(int A[], unsigned int N).

It takes an array and the size of the array and it makes the sort inside the array. A is a reference to the passed array.

And further, in the main(), when I do this: delete[] A, it launches the error window with the message I described above.

I am not able to explain what happened. Passing the dynamic array to an function that has A[] as a parameter has transformed it into an automatic array? I'm running out of ideas, here.

Can someone explain me what is the problem? This is the complete code:

#include <iostream>
#include <time.h>
#include <string>
#include <fstream>
#include <stdio.h>

using namespace std;

void Swap(unsigned int i, unsigned int j, int A[])
{
	int z= A[i];
	A[i] = A[j];
	A[j] = z;
}

unsigned int Right(unsigned int i)
{
	return 2 * i + 1;
}

unsigned int Left(unsigned …