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 › [question] switch/class/struct

[question] switch/class/struct

Posts 1–9 of 9 · Page 1 of 1
MO
mookamoka3
[question] switch/class/struct
I'll just give a big beefy example :

Code:
#include "stdafx.h"
#include <iostream>

using namespace std;

void ChoosePosition(sex positions);

enum sex
{
	doggystyle,
	butterfly,
	anal,
	missionary,
};


int _tmain(int argc, _TCHAR* argv[],sex positions)
{
	ChoosePosition(sex positions);

return 0;
}

void ChoosePosition(sex position){
	switch(position){
	case(doggystyle):
			cout<<"ROUGHH!"<<endl;
	case(anal):
		cout<<"kinky."<<endl;
		break;
	case(missionary):
		cout<<"normal i guess."<<endl;
		break;
	case(butterfly):
		cout<<"I dont even know what this is..."<<endl;
		break;
	default:
		cout<<"whatever you want it to be baby"<<endl;
		break;
	}
}
(my issue is that this code is wrong. I need to figure out how to properly call a function, if that function contains variables from a struct, class, enum or basically anything.) <--- Not sure if this makes sense .

actually just so it's easier for me to understand cuz my brain isnt workin so great right now, i basically need to know how to call ChoosePosition(sex positions); in my main function in this situation.
#1 · 15y ago
Auxilium
Auxilium
i havent seen enums much lately. I guess use alternatives /

i think the problem is that you declared the enum after your function prototype.



#2 · edited 15y ago · 15y ago
MO
mookamoka3
Quote Originally Posted by Koreans View Post
i havent seen enums much lately. I guess use alternatives /

i think the problem is that you declared the enum after your function prototype.



Nah i tried that, didn't work

I'm baffled

The same thing seems to happen for structs and classes though. If i make a struct outside of a function, make a function that uses the variables, and then try to call it in the main function it doesnt work. The error is always that the type in the function call is invalid.. so i try different types and i took the type out altogether and it just says that its undefined XD. Even when I took everything out of the brackets it says that there's too few arguements.

STUMPED.
#3 · 15y ago
Void
Void
[Highlight=C++]

struct Person
{
char* name;
int age;
}

void SomeFunction(Person instance)
{
cout << instance.name;
return;
}

int main()
{
Person Void;
Void.name = "Idk";
Void.age = 14;

SomeFunction(Void);
}
[/Highlight]

Code:
Output: "Idk"
NOTE: void is a data type but in this case I was using my username as a variable name, don't think of it as the void data type.
#4 · 15y ago
master131
[MPGH]master131
Move the enum above the function prototype..

This is what I used, worked for me:
Code:
#include <iostream>

using namespace std;

enum sex
{
	doggystyle,
	butterfly,
	anal,
	missionary,
};

void ChoosePosition(sex positions);

int main()
{
	ChoosePosition(sex(doggystyle));

	return 0;
}

void ChoosePosition(sex position){
	switch(position){
	case(doggystyle):
			cout<<"ROUGHH!"<<endl;
	case(anal):
		cout<<"kinky."<<endl;
		break;
	case(missionary):
		cout<<"normal i guess."<<endl;
		break;
	case(butterfly):
		cout<<"I dont even know what this is..."<<endl;
		break;
	default:
		cout<<"whatever you want it to be baby"<<endl;
		break;
	}
}
#5 · 15y ago
MO
mookamoka3
Figured it out thanks guys !
#6 · 15y ago
why06
why06
Small correction ...

Quote Originally Posted by Void View Post
[Highlight=C++]
int main()
{
Person Void;
Void.name = "PedoWaldo";
Void.age = 23;

SomeFunction(Void);
}
[/Highlight]
#7 · 15y ago
Void
Void
Quote Originally Posted by why06 View Post
Small correction ...

NOBODY ASKED YOU.
#8 · 15y ago
Hell_Demon
Hell_Demon
Unable to +rep why
#9 · 15y ago
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Tags for this Thread

None