About
Pricing
Community
Teams
Start Free Trial
Log in
Nadir Van Thielen
asked on
8/30/2016
C++ if commend select probbelm
I have a problem in c++ in Code::Blocks, do i something wrong whit my if statement !
i Get the error label: error : label 'gravetie' used but not defind same whit the other if statements
#include <iostream>
using namespace std;
int main()
{
int command;
int pause;
cout << "#########################
##########
##########
##########
##########
##########
##" << endl;
cout << "### ###" << endl;
cout << "### P I R O M S.T.A. ###" << endl;
cout << "### ###" << endl;
cout << "#########################
##########
##########
##########
##########
##########
##" << endl;
cout << "### ###" << endl;
cout << "### 1. Run TEST Gravetie ###" << endl;
cout << "### 2. Run TEST beometrics ###" << endl;
cout << "### 3. Run TEST DNA ###" << endl;
cout << "### 4. Run TEST LCARS ###" << endl;
cout << "### 5. Run TEST telportasion ###" << endl;
cout << "#########################
##########
##########
##########
##########
##########
##" << endl;
cout << "### 5. Run D.R.A.R.P.A ###" << endl;
cout << "#########################
##########
##########
##########
##########
##########
##" << endl;
cout << "### ###" << endl;
cout << "### ###" << endl;
cout << "### 0. Exit ###" << endl;
cout << "### ###" << endl;
cout << "#########################
##########
##########
##########
##########
##########
##" << endl;
cin >> command;
if (command == 1) goto gravetie;
if (command == 2) goto beometrics;
if (command == 3) goto DNA;
if (command == 4) goto LCARS;
if (command == 5) goto darpa;
if (command == 0) goto exit;
switch (command)
{
case 'gravetie' :
cout << "gravetie" << endl;
case 'beometrics':
cout << "beometrics" << endl;
case 'DNA':
cout << "DNA" << endl;
case 'LCARS':
cout << "LCARS" << endl;
case 'darpa':
cout << "darpa" << endl;
case 'telportasion':
cout << "telportasion" << endl;
}
cin >> pause;
exit:
return 0;
}
C++
2
1
Last Comment
Nadir Van Thielen
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ste5an
8/30/2016
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Nadir Van Thielen
8/30/2016
ASKER
thanks for the input
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes