generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: C++ Question/Urgent Predicament

Previous Thread :: Next Thread 
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
18 Jan 2017 07:36 PM
Sorry its not scripting, but apparently, you can only ask the one question on stack overflow a day, and frankly, the people there are a whole lot more rude than they are here.

I am having a problem and I really have no idea what the alternative is. There is some code I excluded for sake of making it extremely long.

s t and d is a butchered way of printing in the console, its butchered to pass through the filter.

void ProcessCommand() {
string CurrentCommand;

s t and d : c o u t << ": ";
s t and d : c i n >> CurrentCommand;

if (CurrentCommand == " L i s t U s e r s ( ) " )
{
s t and d : c o u t << Users << end l;
ProcessCommand(); //Reset it so that you can use another command.
}

if (CurrentCommand == " L o g O u t ( ) ")
{
main (); //Reset the entire thing so that you can use a different user
}
}


int main()
{
//Set up stuff, to long to show in here.

//Bleh bleh bleh if there is a valid user and pass then:

ProcessCommand(); //Cool right? No. Because ProcessCommand is above it, it won't run. If I do put ProcessCommand below it, I won't be able to execute the main function for some reason.

}

Report Abuse
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
18 Jan 2017 07:37 PM
Try forward declaring it by putting 'void ProcessCommand();' above your main segment.

Then define the function after the main segment.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Jan 2017 07:39 PM
Forward declare it then
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Jan 2017 07:39 PM
Ah first post of the day I get ninja'd
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
18 Jan 2017 07:40 PM
This is actually pretty easy to understand if you look at it. I just have a function called "ProcessCommand" that takes in user input and executes an action based on what it is.

Everytime a command is called, (unless its ":LogOut()" ) then the function "ProcessCommand()" is called again so you can type another command in.

When you use :LogOut() its supposed to restart the entire thing and make you put in your username and pass.
Report Abuse
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
18 Jan 2017 07:40 PM
i apologize
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
18 Jan 2017 07:42 PM
w0t in tarnation is a forward declaration? I literally can't find it on the internet.
I don't need you to incorporate it into my code, but just like show me a simple example.
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
18 Jan 2017 07:44 PM
####################################################################################################
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
18 Jan 2017 07:45 PM
http://www.

learncpp.
com/cpp-tutorial/ 17-forward-declarations/





one google search: "forward declarations c++"


#code self = nil
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
18 Jan 2017 07:45 PM
This is probably why you were coldly received in stack overflow.
Googling: c plus plus forward declaration

yields a plethora of results
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
18 Jan 2017 07:47 PM
^ Precisely, but I thought maybe they would shunn me if I used a language other than that of scripting here.

I started using this yesterday. .-.
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
18 Jan 2017 07:51 PM
My eyes have been opened unto heaps of new information. Thank you for sharing that website.

I feel as the world of C++ consumes me, develops me, becomes me.
Bye bye lua, lmao.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Jan 2017 07:53 PM
...
Report Abuse
Froast is not online. Froast
Joined: 12 Mar 2009
Total Posts: 3134
18 Jan 2017 07:55 PM
many smart!
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
18 Jan 2017 07:56 PM
"I feel as the world of C++ consumes me, develops me, becomes me."
u ok

Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
18 Jan 2017 07:58 PM
^ idek, btw I figured it out, you guys are heaps of help.
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
18 Jan 2017 08:00 PM
For all those wondering, the reason I am so stupid with this is because I figured out how to make a "Hello World" file a little more than 12 hours ago.
Report Abuse
nox7 is not online. nox7
Joined: 29 Aug 2008
Total Posts: 27467
18 Jan 2017 08:01 PM
Welcome to the big world of programming. The amount of rules will be overwhelming. Enjoy Dante's Inferno.
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
18 Jan 2017 08:20 PM
Learning lua has really been a big help so far.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image