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 › Problem Learning

Problem Learning

Posts 16–30 of 41 · Page 2 of 3
Hell_Demon
Hell_Demon
heres the problem:
double Feet;
and
double Furlong = Ft2Frlng(Feet);

What type is the param of Ft2Frlng? and what are you passing to it?
#16 · 16y ago
ilovecookies
ilovecookies
Quote Originally Posted by Hell_Demon View Post
heres the problem:
double Feet;
and
double Furlong = Ft2Frlng(Feet);

What type is the param of Ft2Frlng? and what are you passing to it?
Yup. I figured it out. =) I changed the Param of Ft2Furlong(int) to Ft2Furlong(double) and Ft2Furlong(double Feet). Now i'm struggling to compile a program that has 2 functions in it that prints
Code:
Three Blind Mice.
Three Blind Mice.
See How They run.
See How They Run.
I recon I use void functionname(void) but I don't now what I would return? But if I have to return Three Blind Mice, wouldn't I need a return of some sort? Would it be String? char? What?
#17 · 16y ago
Hell_Demon
Hell_Demon
Quote Originally Posted by ilovecookies View Post
Yup. I figured it out. =) I changed the Param of Ft2Furlong(int) to Ft2Furlong(double) and Ft2Furlong(double Feet). Now i'm struggling to compile a program that has 2 functions in it that prints
Code:
Three Blind Mice.
Three Blind Mice.
See How They run.
See How They Run.
I recon I use void functionname(void) but I don't now what I would return? But if I have to return Three Blind Mice, wouldn't I need a return of some sort? Would it be String? char? What?
A void does not return anything.
either use return; at the end of your void or nothing at all(both are fine).
#18 · 16y ago
ilovecookies
ilovecookies
This is where i'm at right now HD

Code:
#include <iostream>

char ThrBlMi();
char CHwThyRn();

int main()
{
    using namespace std;
    cout << ThrBlMi() << endl;
    cout << ThrBlMi() << endl;
    cout << CHwThyRn() << endl;
    cout << CHwThyRn() << endl;
    system("pause");
    return 0;
}

char ThrBlMi()
{
      return "Three Blind Mice.";
}

char CHwThyRn()
{
       return "See How They Run.";
}

I get errors and I know why, but I don't know how to fix it. It's because i'm using char as the function header. But I don't know what I could use. I tried string and it said string was invalid. What does my header need to be to get the return i'm looking for?
#19 · 16y ago
Disturbed
[MPGH]Disturbed
Quote Originally Posted by ilovecookies View Post
This is where i'm at right now HD

Code:
#include <iostream>

char ThrBlMi();
char CHwThyRn();

int main()
{
    using namespace std;
    cout << ThrBlMi() << endl;
    cout << ThrBlMi() << endl;
    cout << CHwThyRn() << endl;
    cout << CHwThyRn() << endl;
    system("pause");
    return 0;
}

char ThrBlMi()
{
      return "Three Blind Mice.";
}

char CHwThyRn()
{
       return "See How They Run.";
}

I get errors and I know why, but I don't know how to fix it. It's because i'm using char as the function header. But I don't know what I could use. I tried string and it said string was invalid. What does my header need to be to get the return i'm looking for?
Usualy int, but I just tried to compile it and it said I couldn't convert const char to int :/.

It should be compiling without a problem (At least thats what it seems like to me).

EDIT:
It might be bacuase your calling them in 'cout'. The complier is looking for text to output.

Just and idea, not sure.
#20 · edited 16y ago · 16y ago
ilovecookies
ilovecookies
Really dumb question, but how else could I call them? Just on their own? Like instead of cout just state them?

EDIT!

ObamaBinLaden, i'm getting the same const char conversion error. And i've tried changed my function headers to everything I can think of. No clue what's wrong.
#21 · edited 16y ago · 16y ago
ZE
zeco
Ok the problem as i see it is that the function return type should be char*. A pointer to character, because what you are returning is a string, which in C++ can be represented as a pointer to char. I may be incorrect but that's the first thing that jumped out at me.
#22 · edited 16y ago · 16y ago
A⁴
A⁴
Quote Originally Posted by ilovecookies View Post
Hey, thanks alot for the great explanation! No less than what i've seen you describe to other people. But now I have one last question regarding functions.

Everytime the function is called, do you have to make a prototype? Or do you only have to make the prototype at the initial use of the function?
If so, why don't you thank him?
#23 · 16y ago
ilovecookies
ilovecookies
Quote Originally Posted by zeco View Post
Ok the problem as i see it is that the function return type should be char*. A pointer to character, because what you are returning is a string, which in C++ can be represented as a pointer to char. I may be incorrect but that's the first thing that jumped out at me.
Alright! That brings up a whole new issue. I haven't quite reached pointers yet. Should I just abandon said project until I know more about pointers?

Quote Originally Posted by AirBourne View Post
If so, why don't you thank him?

I just went through and thanked everyone who replied to my thread. No information is bad information.
#24 · edited 16y ago · 16y ago
LA
lalakijilp
original:

Code:
#include <iostream>

char ThrBlMi();
char CHwThyRn();

int main()
{
    using namespace std;
    cout << ThrBlMi() << endl;
    cout << ThrBlMi() << endl;
    cout << CHwThyRn() << endl;
    cout << CHwThyRn() << endl;
    system("pause");
    return 0;
}

char ThrBlMi()
{
      return "Three Blind Mice.";
}

char CHwThyRn()
{
       return "See How They Run.";
}
lala's version:

Code:
#include <iostream>

using namespace std;

void ThrBlMi();
void CHwThyRn();

int main()
{
    
    ThrBlMi();
    ThrBlMi();
    CHwThyRn();
    CHwThyRn();
    system("pause");
    return 0;
}

void ThrBlMi()
{
      cout << "Three Blind Mice." <<endl;
}

void CHwThyRn()
{
       cout << "See How They Run." << endl;
}
try to make the code as easy as possible. (in main at least)
when you don't need to use variables in your functions don't call them.

here is another example with .... i forgot the name...

dunno if it works because i am not at my "C++ PC"

edit: tested and works

when there is no variable put in when calling the function foramountoftimesdisplayed is 1.

lala's 1337 version:
Code:
#include <iostream>

using namespace std;

void ThrBlMi(int amountoftimesdisplayed = 1);
void CHwThyRn(int amountoftimesdisplayed = 1);

int main()
{
    ThrBlMi(2);
    CHwThyRn(2);
    system("pause");
    return 0;
}

void ThrBlMi(int amountoftimesdisplayed)
{
      for(int i=1; amountoftimesdisplayed >= i; i++)
      cout << "Three Blind Mice." <<endl;
}

void CHwThyRn(int amountoftimesdisplayed)
{
       for(int i=1;amountoftimesdisplayed >= i; i++)
       cout << "See How They Run." << endl;
}
#25 · edited 16y ago · 16y ago
Hell_Demon
Hell_Demon
Quote Originally Posted by ilovecookies View Post
This is where i'm at right now HD

Code:
#include <iostream>

char ThrBlMi();
char CHwThyRn();

int main()
{
    using namespace std;
    cout << ThrBlMi() << endl;
    cout << ThrBlMi() << endl;
    cout << CHwThyRn() << endl;
    cout << CHwThyRn() << endl;
    system("pause");
    return 0;
}

char ThrBlMi()
{
      return "Three Blind Mice.";
}

char CHwThyRn()
{
       return "See How They Run.";
}

I get errors and I know why, but I don't know how to fix it. It's because i'm using char as the function header. But I don't know what I could use. I tried string and it said string was invalid. What does my header need to be to get the return i'm looking for?
try this:
Code:
prototype:
char *CHwThyRn();

function:
char *CHwThyRn()
{
    char *retbuf="See How They Run.";
    return retbuf;
}
Apply the same to the other function
Try figuring out why this works by yourself. if you're unable to figure it out just ask
#26 · 16y ago
Disturbed
[MPGH]Disturbed
Quote Originally Posted by Hell_Demon View Post
try this:
Code:
prototype:
char *CHwThyRn();

function:
char *CHwThyRn()
{
    char *retbuf="See How They Run.";
    return retbuf;
}
Apply the same to the other function
Try figuring out why this works by yourself. if you're unable to figure it out just ask
This would also allow you to call them the way you previously were.
#27 · 16y ago
ilovecookies
ilovecookies
Quote Originally Posted by Hell_Demon View Post
try this:
Code:
prototype:
char *CHwThyRn();

function:
char *CHwThyRn()
{
    char *retbuf="See How They Run.";
    return retbuf;
}
Apply the same to the other function
Try figuring out why this works by yourself. if you're unable to figure it out just ask


I integrated this into my program, but now it just displays "Press any key to continue..." It doesn't display the contents of the functions. This is the code

Code:
#include <iostream>

char *ThrBlMi();
char *CHwThyRn();

int main()
{
    using namespace std;
   char *ThrBlMi();
   char *ThrBlMi();
   char *CHwThyRn();
   char *CHwThyRn();
    system("pause");
    return 0;
}

char *ThrBlMi()
{
      char *retbuf="Three Blind Mice";
      return retbuf;
}

char *CHwThyRn()
{
       char *retbuf="See How They Run.";
       return retbuf;
}
#28 · 16y ago
Hell_Demon
Hell_Demon
Quote Originally Posted by ilovecookies View Post
I integrated this into my program, but now it just displays "Press any key to continue..." It doesn't display the contents of the functions. This is the code

Code:
#include <iostream>

char *ThrBlMi();
char *CHwThyRn();

int main()
{
    using namespace std;
   char *ThrBlMi();
   char *ThrBlMi();
   char *CHwThyRn();
   char *CHwThyRn();
    system("pause");
    return 0;
}

char *ThrBlMi()
{
      char *retbuf="Three Blind Mice";
      return retbuf;
}

char *CHwThyRn()
{
       char *retbuf="See How They Run.";
       return retbuf;
}
Code:
#include <iostream>

char *ThrBlMi();
char *CHwThyRn();

int main()
{
    using namespace std;
    cout<<ThrBlMi()<<endl;
    cout<<ThrBlMi()<<endl;
    cout<<CHwThyRn()<<endl;
    cout<<CHwThyRn()<<endl;
    system("pause");
    return 0;
}

char *ThrBlMi()
{
      char *retbuf="Three Blind Mice";
      return retbuf;
}

char *CHwThyRn()
{
       char *retbuf="See How They Run.";
       return retbuf;
}
#29 · 16y ago
ilovecookies
ilovecookies
Quote Originally Posted by Hell_Demon View Post
Code:
#include <iostream>

char *ThrBlMi();
char *CHwThyRn();

int main()
{
    using namespace std;
    cout<<ThrBlMi()<<endl;
    cout<<ThrBlMi()<<endl;
    cout<<CHwThyRn()<<endl;
    cout<<CHwThyRn()<<endl;
    system("pause");
    return 0;
}



char *ThrBlMi()
{
      char *retbuf="Three Blind Mice";
      return retbuf;
}

char *CHwThyRn()
{
       char *retbuf="See How They Run.";
       return retbuf;
}


Ooooh oh oh oh, I should've went with my original coding which included the cout object so it can display the content of the character pointer. But what differs a character pointer from a variable? Or are these questions i'll have answered by the book soon enough?
#30 · 16y ago
Posts 16–30 of 41 · Page 2 of 3

Post a Reply

Similar Threads

  • WPE problem...By styx23 in General Game Hacking
    8Last post 20y ago
  • Problem Wit Hacking ProgramsBy f5awp in General Gaming
    5Last post 20y ago
  • Where could I learn C++? (Beginner, and Advanced stuff)By TsumikiriX in C++/C Programming
    8Last post 20y ago
  • Looking to learn.By SadisticGrin in Hack Requests
    1Last post 20y ago
  • Learn HackingBy Loler in Hack Requests
    2Last post 20y ago

Tags for this Thread

#learning#problem