本文整理汇总了C++中printMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ printMenu函数的具体用法?C++ printMenu怎么用?C++ printMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printMenu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ClearScreen
void BootMenu::Init()
{
AbstractState::Init();
ClearScreen();
printMenu();
}
开发者ID:henla464,项目名称:WiRoc-Arduino,代码行数:7,代码来源:BootMenu.cpp
示例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;
}
开发者ID:InteractiveApps,项目名称:Eugenics,代码行数:32,代码来源:Stack.c
示例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;
}
开发者ID:Aidsy,项目名称:Remote-Autonomous-Vehicle-Explorer-Network,代码行数:30,代码来源:WyvernController.c
示例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;
}
开发者ID:patxu,项目名称:cs50-Software-Design-and-Implementation,代码行数:28,代码来源:network.c
示例5: pthread_mutex_lock
void Debugger::halt()
{
pthread_mutex_lock(&printingMutex);
state = dsHaltPending;
printMenu();
pthread_mutex_unlock(&printingMutex);
}
开发者ID:bigfatbrowncat,项目名称:Vintage,代码行数:7,代码来源:Debugger.cpp
示例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;
}
开发者ID:dvirazulay,项目名称:homework,代码行数:33,代码来源:main.c
示例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;
}
开发者ID:red-rick,项目名称:CFundamentals,代码行数:27,代码来源:main.cpp
示例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;
}
}
开发者ID:fesse,项目名称:timelaps_arduino,代码行数:46,代码来源:Menu.cpp
示例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;
}
开发者ID:carlosmccosta,项目名称:Airport-Management-System,代码行数:9,代码来源:PortaEmbarque.cpp
示例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 () */
开发者ID:KarenHung,项目名称:ecosgit,代码行数:44,代码来源:test_menu.c
示例11: printArrow
void InboundRadioNodeMenu::Init()
{
AbstractState::Init();
if (!initialized) {
numberOfNodes = Settings::GetInboundRadioNodes(nodes);
initialized = true;
}
printArrow();
printMenu();
}
开发者ID:henla464,项目名称:WiRoc-Arduino,代码行数:10,代码来源:InboundRadioNodeMenu.cpp
示例12: main
int main(int argc, char** argv) {
atexit(sudokuExit);
printWelcomeScreen();
CLEAR;
printMenu();
// printSudoku(grid);
//
return (EXIT_SUCCESS);
}
开发者ID:harrytodorov,项目名称:dhbw_sudoku,代码行数:10,代码来源:main.c
示例13: menu_loop
void menu_loop(void const *args)
{
int count = 0;
while(true)
{
setMenu();
if (++count % 10 == 0)
printMenu(menuItem);
Thread::wait(100);
}
}
开发者ID:cllebrun,项目名称:IBMIoTClientEthernetExample1015,代码行数:11,代码来源:main.cpp
示例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;
}
开发者ID:gueTo,项目名称:laboratorioAlgoritmiEStruttureDati,代码行数:11,代码来源:es1main.c
示例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;
}
开发者ID:nathankent22,项目名称:C-Library,代码行数:20,代码来源:test.c
示例16: main
int main(int argc, char *argv[])
{
char input[5] = " ";
char *address = argv[1];
while(strcmp(input,"quit")!=0)
{
printMenu(input,address,input);
}
return 0;
}
开发者ID:Remer94,项目名称:Hangman,代码行数:11,代码来源:menu.c
示例17: main
int main()
{
Library lib;
int select = 0;
lib.fBooks = "books.txt";
lib.fCustomers = "customers.txt";
// Load Books
if(!loadBooks(lib.fBooks, lib.books, lib.maxBooks, lib.numBooks))
{
cout << "Failed to Load Books" << endl;
return 0;
}
// Load Customers
if(!loadCustomers(lib.fCustomers, lib.customers, lib.maxCust, lib.numCusts))
{
cout << "Failed to Load Customers" << endl;
return 0;
}
// Menu
while(select != 6)
{
printMenu();
cin >> select;
cout << endl;
if(select == 1)
{
// List Books
printBooks(lib.books, lib.numBooks);
}
else if(select == 2)
{
// Add Book To Deposit
cout << "Book Title: ";
cin.ignore();
getline(cin, lib.books[lib.numBooks].title);
cout << "Year Published: ";
cin >> lib.books[lib.numBooks].yearPublished;
cout << "Number of Pages: ";
cin >> lib.books[lib.numBooks].pages;
lib.books[lib.numBooks].checkedOut = false;
lib.numBooks++;
cout << "Book added." << endl << endl;
}
else if(select == 4)
开发者ID:lukepierce,项目名称:Introduction-To-CPlusPlus,代码行数:53,代码来源:main.cpp
示例18: getMenuChoice
/*
* This method gets the menu choice from the user.
*/
char getMenuChoice(void){
unsigned char c;
printMenu();
c = getc(stdin);
#ifdef DEBUG
printf("Your choice: %d\n", c);
#endif
if(c != '0'){
getc(stdin);
// This gets the "enter" key ('\r') and eats it so the loop isn't continued.
}
return c;
}
开发者ID:parkr,项目名称:COMP206-Practice,代码行数:16,代码来源:menu.c
示例19: start
int start()
{
int opcion = 0;
ArrayList *calendario = al_newArrayList();
cargarEventosDeArchivo(calendario);
do
{
system("cls");
printMenu();
pedirInt(&opcion,"Ingrese una opcion:\n",7,1,"Ingrese una opcion valida. Entre 1 y 6\n");
switch(opcion)
{
case NUEVO:
if(crearNuevoEvento(calendario))
printf("Hubo un error al intentar crear el evento\n");
pausa("Presione una tecla para volver\n");
break;
case CONSULTAR_DIA:
if(consultarFecha(calendario))
printf("Hubo un error con la consulta\n");
pausa("Presione una tecla para volver\n");
break;
case MODIFICAR:
if(modificarEvento(calendario))
printf("No se pudo completar la modificacion\n");
break;
case ELIMINAR:
if(eliminarEvento(calendario))
printf("No fue posible eliminar el evento\n");
pausa("Presione una tecla para volver\n");
break;
case EXPORTAR:
if(exportarCalendario(calendario))
printf("Hubo un error al intentar exportar el calendario\n");
pausa("Presione una tecla para volver\n");
break;
case LIMPIAR:
if(limpiarCalendario(calendario))
printf("No se pudo completar la operacion\n");
pausa("Presione una tecla para volver\n");
break;
}
}while( opcion != SALIR);
guardarEventosEnArchivo(calendario);
limpiarMemoria(calendario);
calendario->deleteArrayList(calendario);
return 0;
}
开发者ID:Maxi-Di-Mito,项目名称:tp_laboratorio_1,代码行数:51,代码来源:lib.c
示例20: MenuInteract
tInt8 MenuInteract(tOutput* output,tMenu* Menu,tInt16 offsy,tInt16 offsx)
{
tInt16 ch;
int i;
tInt8 retval;
ch=0;
printMenu(output,Menu,offsy,offsx);
while (ch!=KEYENTER)
{
ch=getkey((tKeyTab*)output->pKeyTab,0);
switch(ch)
{
case KEYLEFT: MenuMoveLeft(Menu); break;
case KEYRIGHT: MenuMoveRight(Menu); break;
case KEYUP: MenuMoveUp(Menu); break;
case KEYDOWN: MenuMoveDown(Menu); break;
case KEYTAB: Menu->menuitemactive=(Menu->menuitemactive+1)%Menu->menuitemnum;break;
case KEYENTER: retval=Menu->menuitemactive; break;
default:
if (ch>=' ' && ch<127)
{
if (ch>='a' && ch<='z') ch-=32;
for (i=0;i<Menu->menuitemnum;i++)
{
if (Menu->MenuItems[i].hotkey==ch)
{
Menu->menuitemactive=i;
ch=KEYENTER;
}
}
}
break;
}
printMenu(output,Menu,offsy,offsx);
}
return Menu->menuitemactive;
}
开发者ID:JamesLinus,项目名称:LiteBSD-Ports,代码行数:38,代码来源:menu.c
注:本文中的printMenu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论