本文整理汇总了C++中printMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ printMenu函数的具体用法?C++ printMenu怎么用?C++ printMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printMenu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClearScreen
void BootMenu::Init()
{
AbstractState::Init();
ClearScreen();
printMenu();
}
示例2: main
int main() {
struct stack p;
int data,ch, data1, m;
printf("Enter the maximum size of the stack\n");
scanf("%d",&m);
initstack(&p,m);
do {
printMenu();
printf("Enter your choice\n");
scanf("%d",&ch);
switch(ch) {
case 1:
printf("Enter the element to be pushed\n");
scanf("%d",&data);
push(&p, data);
break;
case 2:
data1 = pop(&p);
if(data1 != -1000)
printf("The popped element is %d\n",data1);
break;
case 3:
printf("The contents of the stack are");
display(p);
printf("\n");
break;
default:
return 0;
}
} while(1);
return 0;
}
示例3: main
/*************************************************************************
Function: main()
**************************************************************************/
int main(void){
init_wyvern();
LED_green_on();
LED_ucgreen_on();
char input;
menuScreen = 'a';
for( ; ; ){
printMenu();
input = '0';
outgoing.command = input;
if(DataInReceiveBuffer()){
input = ReceiveByte();
}
getJoystick();
controllerCommand(input);
controllerTransmit();
_delay_ms(5);
if(incoming.battery < 100){
LED_red_toggle();
LED_ucred_toggle();
LED_blue_toggle();
LED_yellow_toggle();
LED_green_toggle();
}
}
return 0;
}
示例4: main
int main(){
while( 0 == 0 ) {
printMenu();
printf("Enter command: ");
scanf("%s", choice);
if (choice[0]=='i'){
interactive();
}
else if (choice[0]=='a'){
automatic();
}
else if (choice[0]=='e'){
printf("exiting\n\n");
break;
}
else
printf("Please enter a valid option\n");
if (status == 1){ //only print the final addresses if everything has gone accordingly
printAddress();
status=0; //reset status
}
}
return EXIT_SUCCESS;
}
示例5: pthread_mutex_lock
void Debugger::halt()
{
pthread_mutex_lock(&printingMutex);
state = dsHaltPending;
printMenu();
pthread_mutex_unlock(&printingMutex);
}
示例6: main
int main(int argc, char **argv){
if (argc < 2) {
printf("No filename given.\n");
exit(1);
}
char* filename = argv[1];
int choice;
int menuSize = 4;
struct fun_desc menu[] = {
{"Mem Display", &memDisplay},
{"File Display", &fileDisplay},
{"File Modify", &fileModify},
{"File Copy", &fileCopy}
};
printf("File: %s\n", filename);
while (1) {
printMenu(menu, menuSize);
printf("Choice: ");
choice = getInt();
if (choice > 3 || choice < 0) {
break;
}
(menu[choice].fun)(filename);
}
printf("Bye!\n");
return 0;
}
示例7: main
int main()
{
char ch;
printMenu();
while(std::cin >> ch) {
switch(ch) {
case 'a' :
std::cout << "Nice choice\n";
break;
case 'b' :
std::cout << "Try another letter\n";
break;
case 'c' :
std::cout << "It's great, but not\n";
break;
case 'd' :
std::cout << "ZzZzZz..\n";
break;
default:
std::cout << "Please enter a, b, c or d: ";
}
}
std::cin.get();
return 0;
}
示例8: handleSubInput
void Menu::parseInput() {
if (!hasInput()) {
return;
}
String data = Serial.readString();
if (currentMenuChoice != MENU_NONE) {
handleSubInput(data);
return;
}
switch (data.toInt()) {
case 0:
printMenu();
break;
case MENU_SET_NBR_PHOTOS:
Serial.println("Enter number of photos");
currentMenuChoice = MENU_SET_NBR_PHOTOS;
break;
case MENU_SET_EXPOSURE_TIME:
Serial.println("Enter wait time per photo [ms]");
currentMenuChoice = MENU_SET_EXPOSURE_TIME;
break;
case MENU_SET_MOTOR_RUN_TIME:
Serial.println("Enter trolley move time [ms]");
currentMenuChoice = MENU_SET_MOTOR_RUN_TIME;
break;
case MENU_SET_DIRECTION:
Serial.println("Enter trolley direction [L/R]");
currentMenuChoice = MENU_SET_DIRECTION;
break;
case 5:
resetTrolley();
break;
case 6:
start();
break;
case 7:
stop();
break;
case 9:
printStatus();
break;
default:
printMenu();
break;
}
}
示例9: printMenu
void PortaEmbarque::listCategoriasAvioesInfo() {
vector < vector <string> > info;
info.push_back(_categorias_avioes_info);
string title = (string)"Possiveis categorias de aviões";
vector <string> colnames;
colnames.push_back("");
printMenu(title, info, colnames, false, false, false, true);
cout << endl;
}
示例10: menuGetChoice
static int
menuGetChoice (
MENU_ITEM menuTable[],
int numMenuItems,
char *title,
unsigned long options
)
{
/*char inputLine[MAX_INPUT_LINE_SIZE];*/
int choice;
/*
* Suppress display of the menu the first time if we're asked
*/
if (!(options & MENU_OPT_SUPPRESS_DISP))
printMenu (menuTable, numMenuItems, title);
/*
* Prompt for a selection. Redisplay the menu and prompt again
* if there's an error in the selection.
*/
choice = -1;
while (choice < 0 || choice > numMenuItems)
{
diag_printf ("\nEnter the menu item number (0 to quit): ");
choice = decIn ();
if (choice < 0 || choice > numMenuItems)
printMenu (menuTable, numMenuItems, title);
}
if (choice == 0)
return (QUIT);
return (choice - 1);
} /* end menuGetChoice () */
示例11: printArrow
void InboundRadioNodeMenu::Init()
{
AbstractState::Init();
if (!initialized) {
numberOfNodes = Settings::GetInboundRadioNodes(nodes);
initialized = true;
}
printArrow();
printMenu();
}
示例12: main
int main(int argc, char** argv) {
atexit(sudokuExit);
printWelcomeScreen();
CLEAR;
printMenu();
// printSudoku(grid);
//
return (EXIT_SUCCESS);
}
示例13: menu_loop
void menu_loop(void const *args)
{
int count = 0;
while(true)
{
setMenu();
if (++count % 10 == 0)
printMenu(menuItem);
Thread::wait(100);
}
}
示例14: menu
int menu(){
int choiche=0;
printMenu();
do{
if(choiche<0 || choiche>10)
printf("\ninserito numero non ammesso\nPrego reinserire\n");
scanf("%d", &choiche);
getchar();
}while(choiche<0 || choiche>10);
return choiche;
}
示例15: main
int main()
{
char opt;
int i,j;
printMenu();
scanf(" %c", &opt);
while(opt != 'q') {
switch (opt)
{
case 's' : printSquare();
break;
case 't' : printTriangle();
break;
default: printf("Unknown option\n");
}
printMenu();
scanf(" %c", &opt);
}
return 0;
}