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] with simple C++ program...

Exclamation[Help] with simple C++ program...

Posts 1–5 of 5 · Page 1 of 1
ZKPB
ZKPB
[Help] with simple C++ program...
Ok so I have a bit of code:
Code:
#include <iostream>
#include <string>
using namespace std;

int main ()
{
  string firststring = "Did this work? ";
  string secondstring("If it did then I will be happy :D");
  cout << firststring << endl;
  cout << secondstring;
  return 0; 
}
Which works fine, my problem is every time I run it, it only stays open for a fraction of a second, then closes, what do I need to do to make it stay open until I close it? Thanks!

Oh and using Dev-C++ 4.9.9.2 if it makes any difference...
#1 · edited 16y ago · 16y ago
SA
samack
In your code type:
Code:
cin.get();
#2 · 16y ago
ZKPB
ZKPB
Thank you! Worked!

/Mods please close.
#3 · edited 16y ago · 16y ago
Drake
Drake
hey
i got a problem with a simple c++ program ,
when i run the program , it opens but the text wont show up .



Code:
// sample2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream> 
using namespace std;
int main()

{ 
		cin.get();

	cout << "C++ is power programming."; 

	return 0;
}
thank you lalakijilp . thanked u .
#4 · edited 16y ago · 16y ago
LA
lalakijilp
Quote Originally Posted by 3L!T3 View Post
hey
i got a problem with a simple c++ program ,
when i run the program , it opens but the text wont show up .



Code:
// sample2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream> 
using namespace std;
int main()

{ 
		cin.get();

	cout << "C++ is power programming."; 

	return 0;
}
if you run a c++ program it completes all the tasks and then closes.
so in this case it would wait for a key input then show the message and then close. this happens at a large speed so you won't see the message.
the only thing you have to do is switch the cin.get() with the message
#5 · 16y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • HELP WITH SIMPLE CHAMS!By carbon22 in Combat Arms Hacks & Cheats
    7Last post 17y ago
  • Help with CrossFire hacks (Programming)By Nitrous in General Hacking
    0Last post 17y ago
  • New modder Need help with simple text input NOOB!!By rotceh_dnih in Call of Duty Black Ops GSC Modding Help & Discussion
    3Last post 15y ago
  • help with simple injectorBy HaxFrank in Combat Arms Help
    9Last post 16y ago
  • Help With Simple ChamsBy dadon648 in Alliance of Valiant Arms (AVA) Hacks & Cheats
    8Last post 16y ago

Tags for this Thread

None