I am trying to write a menu program that will be broken down into a series of calls to function for each of the menu items. Two of the menu items will be simple programs which I wrote.
I want two of the functions to run one of the two programs I am trying to include as items in the menu.
So far I am only familiar with variables, loops, if statements, and I just learned how to write functions.
The problem I am have is that I don't quite understand how to write a function that will run one of the two programs. Also I am having a hard time writing the program in away that would allow the user to select the menu items.
I'm creating a program that is based on a menu system. Basically each menu is its own user-defined function. The problem is at each menu you can input 'b' to go to the previous menu. I just have it call the function of that menu.
However, do the functions need to complete themselves eventually? If I just keep calling functions will I just keep going further and further deeper into ever running functions?
If so how do I avoid this and yet keep the option to go back to a previous menu/function?
I'm looking for an example of menu selection with arrow key i'dont know how to create one o think i should use CODE ASCI but what method I should follow
I hate vague errors where I don't even know where to start looking for an error. Error happens immediately and it says "Unhandled exception at 0x5981c9c7 (msvcr100d.dll) in experiment.exe: 0xC0000005: Access violation reading location 0xabababab."
I just started learning the basics of programming. While encountering one of the practice problems in the book by Alex Allain I got a little confused. The question is as follows:
Write a menu program that lets the user select from a list of options, and if the input is not one of the options, reprint the list.
The author assumes you can answer this question only using if statements and/or loops (while, for and do).
This is the code I've written thus far:
Code: #include <iostream> using namespace std; int main() { int option; char reset;
[Code] ....
For some reason, the nested while loop keeps repeating even when you input a valid option (1, 2 or 3). I can't seem to figure out why this happens.
But I still do not load the excel file into my program by selecting the program from ContextMenu (right click on excel file and choose program). Although if select the path to excel file from the program, the data from excel file is loaded into the program.
I'm still missing something at function OpenExcelFileWithEasyForm(). How to complete this function to load the excel file into my program when selecting programs in ContextMenu.
Can not seem to get the program to perform the calculations within the cases. Also, how do you set up the a prime function program within the menu. Have been trying for five days now.
This is what I have so far, it gives me a nice menu to select from and it all works but after I make a selection it closes the program. I tried to return to it but it won't work for me
#include <stdio.h> int main() { int choice; int deposit; int balance = 500; { printf(" CHOOSE FROM THE FOLLOWING
I decided to create a simple program to display a menu with options, while that is easy enough I had some difficulty when selecting an option that has options inside which also has an option again. While I had many issues in the past I'm finally finished with it and it works fine, but being new to programming and not knowing various other methods available.
Code: //:::::::::::::::::::::Simple Menu Program:::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
I just started learning C and trying to create a program in C that will have a starting menu for a calculator. The problem is that I could do that with a switch/case but the assignment requires me to use if/else.
Here's what I have so far:
Code:
#include <stdio.h> int calc(); int menu(); int main() { printf("Hello. Welcome to the program. "); printf("Press RETURN key to continue...
[Code]...
How should I go from now using if/else to have those 4 choices?
I tried to write a menu program as a switch-case structure with a separate function for a switch-case structure itself. The outcome for it currently is an undesired one
Code:
#include <iostream> using namespace std; int menu(int answer); int main()
[Code].....
The output I get is one where it's just an infinite loop of "Bad choice! Please try again later.".
I'm trying to write a program that has a menu with a switch statement. I'm getting "case label'1' not within a switch statement" and subsequent errors for the other two choices and the default.
int main(){ int choice; Matrix A,B,C; cout <<"What would you like to do? "<< endl;
I just recently finished up a program that implements Dijkstra's Algorithm and I thought I would make a nice little menu for the user.
so the user can input their locations, I use Getline just in case their location contains spaces. However, when the user selects 2, It skips over the first input for the "Source" location and only lets the user input for the "Destination".
Any reason why this would happen? Am I missing something with Getline? Anyway, here's the code...
The program is not showing my full menu just the 0 Exit and the last line of text. This is the full main source file (not implementation file or header file).
I'm working on what I thought was a pretty simple program. I'm writing a menu driven program that will allow users to obtain specified measurements of several geometric figures. I was trying to test each each time I add a function.
I keep getting this error. error C3861: 'AreaOfSquare': identifier not found.
#include <iostream> #include <string> #include <iomanip> #include <fstream> #include <cmath> using namespace std; int menu() { int choice;
I've read that we can write a program that displays a menu of commands for the user to choose from.We can write some functions that implement these commands, then store pointers to the functions in the array :
We can get a similar effect with a switch statement but using an array of function pointers gives us more flexibility since the elements of the array can be changed as the programm is running.
I decided to write an example about this in order to understand better the context, I am facing some problems though :
Code: TEST2.c:9: warning: initialization from incompatible pointer type TEST2.c:9: warning: initialization from incompatible pointer type TEST2.c:25: error: too few arguments to function "*(arr + (long unsigned int)((long unsigned int)i * 8ul))"
I have to write a program that simulates a handheld gaming system. a system can have power toggled so its either on or off. when the system is on, its volume level can be raised or lowerd. a system has minimum volume level of zero and a maximum volume level of 10. a system stores games.
// simple game menu //simulates a handheld gaming system using namespace std; class Game { public: Game(int GameNumber = 3, int volume = 10);
I have two menu items. When item 1 is disabled, I want item 2 to be disabled as well. In the OnUpdate handler of menu item 1, I have tried to use "t_pMenu = pCmdUI->m_pMenu;", "t_pMenu = pCmdUI->m_pSubMenu;" and "t_pMenu = pCmdUI->m_pParentMenu;" but I always get NULL t_pMenu. How can I achieve this purpose?
I want to create a program that would take an AVI file, alter each frame (ex: change contrast, invert colors, etc.) and dump a new AVI. I've wrote a simple program for this experiment that loads up the header information from the video and dumps it. It also dumps a list of the frame data chunks within the 'movi' chunk.
The info I've gathered from coding this:
1. The recommended buffer size for each type of stream (vids, auds, etc.) is the size of the largest frame of corresponding type, plus 1 or two extra bytes.
2. numFrames in main header is the total number of frames for all types of data (video,audio,etc.) The 'length' value within stream header of type 'vids' is the number of video frames. The sizeImage value within BITMAPINFOHEADER is 921600 (==640*480*3) and the specification states that, quoth, "This can be set to 0 for uncompressed RGB bitmaps."
3. This video uses DIVX encoding.
Now my problem is this: How do I get the data within each video frame in a simple BMP like format? Even the uncompressed frames (with chunk id 'nndb') have variable sizes...let alone the compressed ones.
Information about a software that converts AVIs to a format with fixed sized uncompressed frames. Or at least some information about the frame decompression techniques.
Here's a dump made by the program for a 9 sec, 640x480 video I recorded from Pokemon. (Without the frame dump that is, it'd have made the post too long.)
What I am trying to do is to have the program create 2D array that for each row, no two numbers are the same and only consists numbers between 1-9. The array lists out every possible combinations. Supposely I do not know the number of possible combinations, I had it keep adding new rows until there are no more possiblities left.
The problem with my code is when I print out the completed array, it gives out really, really large numbers. But when I print the array from inside the first loop, it gives correct values. I do not know exactly what happened.
Code: #include <stdio.h> int main(void) { int double_digit[1][2];
i want to create a program which consist of 2 function. one function should find the greatest number and the other one should calculate the average but when i run this program i get segmentation fault
I would like to create a C program which requires the input in this form: number1 operator number2, where number1 and number2 are numbers of type double and operator is one of the characters +,-,*,/.
There is my attempt to write this code:
Code:
#include <stdio.h> double main() { char operator;
[Code]....
Now I have to solve these problems: This code above doesn't work and I don't know why.I don't know how to fix the case when some user enters the input in this form:
Code: 1.5896 *5 or Code: 7 / 5
I mean how the program knows that
Code: 1.5896 *5 is the same as Code: 1.5896*5
I don't know how to fix the case when the user enters the input in the incorrect form for example