is it feasible, inside a C/C++ program, to allocate virtual memory (Swap Space) to have an specific array, to ensure that this program keeps using RAM for that relaxation of variables, and perhaps benefiting from benefit at some form of problems??

For part one: in virtually every modern OS, there's a method to map files to some memory location. You could do this so and employ the file because the "swap space" you describe. The POSIX standards define [cde] (that is functional through Linux and Mac OS) and Home windows has MapViewOfFile.

For that second part: it heavily is dependent on the kind of problems you meet. Odds are it's only will make accesses for your array reduced (as with "absurdly reduced") and never help anything, unless of course this is an enormous array and you are searching for a method to save memory by offshoring contents towards the hard disk. Normally, your OS allocates swap space itself and handles it as being it sees fit, so clearly utilizing a file to supplement memory does not seem like a great choice for almost anything to me.

You need to permit the OS to deal with that. If you choose to "allocate" space around the disk itself, use of your array can be really very slow and thinking about the array may be large procedures onto it would take a long time. All current OS'es should support instantly placing your program memory onto swap or perhaps a page file if this sees fit. If you are not thinking about a performance hit you may create your personal array in "memory" but I would suggest against that as though tips over inside your program throughout runtime than the might not get cleared up and may make trouble.