Beginners - February 2018 (Page 10)

How to make a repeating menu
 
I want to have the printMenu function repeat until user enters 5 which exits the program. I tried placing printMenu() after every option with wrong results. I...
[2 replies] Last: printMenu(); cin>>choice; while (choice!=5) {// run code } ... (by SamuelAdams)
Transferring for loop to while loop in a program
 
I managed to complete the program assignment but out of curiosity, I was wondering if I could transfer this double nested for loop into a nested while loop, I t...
[6 replies] Last: Awesome, now I got it, thanks for the help everyone! (by Bayan Khorshidi Berkeley)
How to get the sum of Ascii values?
 
Hello Community, Once again I kindly ask for help. As the topic suggests, this is what I try to achieve: Finding a way to sum character values in a particula...
[7 replies] Last: Ganado, yes, that is EXACTLY what I wanted! Thank you very much! :-)) (by Misenna)
Comparing values of array after adjusting values
 
Hi,I have an array called int totalscores that is sorted in descending, so it ranges from highest scores to lowest. How would I attach or link a grade accordin...
[1 reply] : Hello! Well, one solution would be to use a dual-selection sort. Mean... (by Misenna)
Bad alloc problem
 
Hi guys I took a break from coding for about a month and already feeling the effects I seem to be getting a bad alloc() exception but I can't seem to figure ou...
[5 replies] Last: thanks Ganado yeah my math was way off also very good point I probab... (by adam2016)
Help with program ASAP!!!!!
 
Below is my code I need help adding the following features: *Print the order summary, including the products, the quantities, and the total price for each pr...
[2 replies] Last: Or you can just add something like this to the end of the program... ... (by Manga)
Skip List C++
 
I'm trying to implement the Skip List using this article http://epaperpress.com/sortsearch/download/skiplist.pdf #include<iostream> #include<cstdlib> #incl...
[2 replies] Last: I've fixed the list, thanks for the help. (by PhantoM123)
strcpy and assignment does not work
 
I am modifying a program to accept command line parameters and I have two tables called "trades" and "quotes". I want to read these from the command line and as...
[8 replies] Last: If you are always passing file names for n tables then you don't need ... (by dhayden)
Getting incorrect return in a function
 
Hi guys, I'm not really good at C/C++ and I'm trying to get my code work for a few days but I couldn't. MAT2 _m_pow2(const MAT2 A, int p) { MAT2 out, aux,...
[4 replies] Last: the result is a random value. I've tested the functions separately and... (by ThiagoCavalcante)
Shipping Charge
 
My professor wants us to write a code for shipping prices: Assignment 4 – Selection (if else) Shipping Calculator: Global Courier Services will ship your pa...
[4 replies] Last: Your code works for me on the test case that you provided. Can you de... (by dhayden)
Why does the cin.fail() to work properly when I input a string or char?
 
EDIT. Can someone please tell me why this crashes my IDE? so what I do is it prompts me to choose an option from a menu, and I input (for an example) wordssss....
[4 replies] Last: Take a look at line 34. After you get a user input you want to check i... (by fiji885)
error C2660: function does not take 0 arguments
 
declare function prototype : myLib.h define function : myLib.cpp void f(const int a=5) { cout << a * 2 << "\n";} funtion f works with argume...
[2 replies] Last: Thanks ! (by george2018)
Sublime C++
 
Can you have c++ code on sublime?.
[2 replies] Last: Can you have c++ code on sublime? C++ code is plain text. You can u... (by Repeater)
Getline not reading the first character, despite there being no ignore statement
 
I have to write a program which reads a file that is this list: Bread 2.49 Y Milk 1.89 N Eggs, dozen 0.97 N Apples 4.75 Y Bananas 1.69 Y Peanut Butter 2.49 Y ...
[4 replies] Last: Thank you very much for the help! (by kevinHobbit91)
Sum of Odds
 
I need help figuring out the formula for this code. The user inputs a list of numbers, then I need the program to compute the sum of all odd numbers I typed in....
[3 replies] Last: ^^^ good catch.. I took the int off sum instinctively but didnt catch... (by jonnin)
Function to alter a variable value and then return to the function?
 
So for a project, I'm creating an adventure game. One of the requirements is at the start of every room, it needs to display how much oxygen is left. I was init...
[1 reply] : like this? void foo(int &value) { value--; } ... cout << reaval... (by jonnin)
Need help with creating a table
 
Hello everyone. So, I was given this assignment recently and I am thoroughly stumped. The end goal for the program is to display BMI in a matrix. It has a row a...
[1 reply] : if you just want to produce output in table form, you need more stuff ... (by jonnin)
C++ Calendar Error
 
I'm working on making a basic calendar program using a FOR loop cycle, I have everything correct until I work on the row alignment with dates. The dates are sup...
[2 replies] Last: Thank you! Everything was solved! Probably the only error now is if th... (by AkelaMan)
Function returning a function
 
I want to call a function that returns a pointer to the right function depending on what inputChar is. All the functions returned are void and take no parameter...
[1 reply] : The pointer-to-function syntax is a bit unintuitive, particularly when... (by helios)
Help appreciated!
 
So I have a string called "A" that I wanna compare to a number of strings. something like this String a; a = "fruit"; if(a == "fruit" or "be...
[1 reply] : String a; a = "fruit"; if(a == "fruit" or a =="berry" or a =... (by Repeater)
February 2018 Pages: 1... 89101112... 28
  Archived months: [jan2018] [mar2018]

This is an archived page. To post a new message, go to the current page.