Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › [Help] Working with dynamic memory

[Help] Working with dynamic memory

Posts 1–7 of 7 · Page 1 of 1
yodaliketaco
yodaliketaco
[Help] Working with dynamic memory
In order to better understand dynamic memory allocation, I have tried to make a program that lists the digits of the fibonnaci sequence in order, using arrays to make infinitely long numbers possible. I am coming up with 31 errors compiling it. Is there anything fundamentally wrong, or just typos? Please help me understand this topic for C++.
P.S. -Will it work so that I can add sequence to an array without predetermining the amount of integers needed and without deleting and recreating the array each time? If not, please give me some suggestion on how to get around the issue of copying all the data from each array into a new one every time it gets too small and needs to be deleted.
-Thanks
Yodaliketaco
(2ND PROGRAM IN C++, AFTER MY CROSSHAIR)

Code:
#include <iostream>
#include <new>
#include <dos.h>
#include <windows.h>
using namespace std;

int d = 0;
int m;
int n = 0;
int * p;
int * pp;
int * ppp;
p= new int one[d];
pp= new int two[d];
ppp= new int three[d];
one [0] = 0;
two [0] = 1;

void printmemmm (int num[], int g)
{
	int s;
	for (s=0; s<g; s++)
		cout << num[s];
}

void sequence (&int mem[], &int memm[], &int memmm[])
{
adding:
	if (mem[n]+memm[n])<10 & n<d)
	{
		memmm[n] = (mem[n]+memm[n]);
		if (n<d)
			n++;
	}
	int c;
	c = (mem[n]+memm[n])%10;
	memmm[n+1] = c;
	n++;
	if (n<d)
		goto adding;
	else
	{
		m = 0;
		if (m<d)
		{
			mem[m] = memm[m];
			memm[m] = memmm[m];
			m++;
		}
		else
		{
			d++;
		}
	}
}
int main ()
{
	if (1 == 1)
	{
	sequence (one, two, three);
	printmemmm (three, d);
	Sleep(10);
	}
	return 0;
}





My original code using long double integers that functioned correctly was as follows. I am trying to make a version of this code that will not encounter an error after 1.30699e+308, which is the most long doubles can hold in this instance. I am trying to do this using a dynamic array, but I have trouble getting the initialization and modification of the array to work correctly.


Code:
#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <math.h>
using namespace std;

int main ()
{
	int f;
	f = 1;
	do
	{
	int y;
	int t;
	cout << "How much delay would you like in between numbers (miliseconds)" << endl << "Type any number of miliseconds then press enter    ";
	cin >> t;
	y = 1;
	if(y == 1)
{
	long double a;
	a = 0;
	long double b;
	b = 1;
	long double c;
	c = a + b;
	cout << a << ", ";
	Sleep(t);
	cout << b << ", ";
	Sleep(t);
	while (c < 1.30699e+308)
	{
		cout << c << ", ";
		a = b;
		b = c;
		c = a + b;
		Sleep(t);
	}
	cout << endl << "You have reached the limit of compution using standard variables" << endl;
	cout << endl << "If you would like to start again press 1 if not press anything else (then enter)";
	cin >> f;
	}
	}
	while (f == 1);
	return 0;
}
Hell_Demon: added code tags.
#1 · edited 16y ago · 16y ago
Void
Void
I don't think you're able to initialize variables that way, when you used the new operator.

[php]
p = new int one[d];
[/php]

It should be.

[php]
p = new int[d];
[/php]

now 'p' has 'd' elements. Which in your case is 0, may I ask why?

Sorry, I'm not understanding what you're trying to do here..
#2 · 16y ago
MW
mwb1234
May I ask which compiler you are using sir?
#3 · 16y ago
yodaliketaco
yodaliketaco
I am using visual studio 2008 express edition for C++ compiling. The point of the program is to list the numbers in the fibonnaci sequence without having errors when the numbers become too large to be stored in normal variables (like integer or long double).

The fibonnaci sequence is 0,1,1,2,3,5,8,13,21,34, etc... Each number is the previous two numbers added together, and the first two numbers are 0 and 1.

If I use p = int[d] for initialization, how can I reference the array, as it has no name? I meant to use "one" to reference the array within the main of the code.

p is meant to be a pointer that holds the address of the beginning of the code for the int array one, so that I can modify the program to delete the array at a later time for modification of size by referencing it with the pointer located within variable p.
#4 · edited 16y ago · 16y ago
serpentine
serpentine
Code:
int a;
int b;
int c;

int main()
{
    a = 0;
    b = 1;

    while (true)
    {
        c = a + b;
        printf(a, b, c);
        c = a += b;
        b += a;
        printf(a, b, c);
     }
}
That should do it. =/
#5 · 16y ago
NW
nwilliams
Which memory would be the best to work with? Right now I am using C++ which is also great but I want to modify my work more with sufficient and in an effective manner.
#6 · 16y ago
why06
why06
This is actally a really difficult problem. once u go past the largest data type there's huge issues w/ displaying, adding, and storing numbers that large. mathemeticians should be the only ones who have to encounter problems like this. Really the only way to solve this problem that I can think of would be at the assembly level, but perhaps there is some nice library out there u can use, to use really large numbers. But yeh what ur doing gives professional programmers a headache.
#7 · 16y ago
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

  • Developing an aimbot that works with information stored in memory... Need assistanceBy ScottOwnsK in General
    2Last post 19y ago
  • Bypass 2.5 Doesn't Work with My Vista! HELP!!!By saefine in Combat Arms Hacks & Cheats
    10Last post 17y ago
  • [Help] How do you get DDD555 aimbot to work with Xfire chams?By HAPPYxHACKING in Combat Arms Hacks & Cheats
    1Last post 17y ago
  • Help. Exp with computers, mods not workingBy gatorzfan12 in Combat Arms Help
    3Last post 16y ago
  • Aimbot 3v1 isn't working and no1 on help threads isnt helping me with my questionBy wildman008a in Combat Arms Hacks & Cheats
    28Last post 17y ago

Tags for this Thread

#c++#dynamic#memory