Hi….
Sorry for my English and for my question but I’ve very big problem!!

This is my first question in this forum, but I’ve a very big problem. I’m writing a code for Borland C 3.1 that has a function with the following prototype:

Code:
Void Retrun_string (int byte1, int byte2, char *ptr)
The function take in input the 2 byte and wrote, in output, to a char pointed by ptr pointer a string:

Code:
Char *other_string[25];

My problem is that in this fuction there are lots of string allocation (more than 64K), all string vector are of the type:


Code:
const char *string[] = {
		“string1”,
		“string2”,
		……
		“stringN”,
}

I’ve lots of this vector because I need to make lots of correspondence between the two bytes and the string. And I use this way for making an easier:

Code:
Strcpy (ptr, string[n]);
The problem is that I must work in a windows 98 space with a Borland c 3.1 (1991). I found on the web that with this kind of workspace there is lots of memory problem because this compiler (that works in MSdos emulation on win98) doesn’t allowed more than 64k of memory. When I run my program I’ve a runtime error in the memory that every times changed and is not periodic but very random. Sometimes my program run without problems, some times all the system crashed, like a MATRIX screensaver. I note that I wrote (random) in lots of parts of memory system for example so0metimes “I” wrote in the keyboard memory, or in the video memory or in the system memory. If I’m lucky the system tell me that I’m trying to access to a reserve and critical part of the memory.

I can’t use an extern file for downloading on runtime the needed string. If I run the program with out my fuction (all the fuction commented) I’ve not problems, nothing. If I run with the entire string vector commented I’ve not running problem. I think the problem are the strings!

When I run my executable file on a winxp workstation I’ve fewer problems… but I must work on 98 systems…. I tried to working with out a pointer in my fuction, but I’ve the same problems. I tried changing with this other fuction:


Code:
Static char string2[25];
Retrun_string (int byte1, int byte2)
{
	….
	Strcpy (string2, string[n]);
}
I found on te web lots of people with memory troubles in Borland C, very similar to mine. Lots of people migrate to Borland 5 or made a file where put all the string, but I can’t!