Beginners - September 2016 (Page 32)

Just a hint please
 
Ok so just to let you know that this is a homework question so don't solve it for me but give me some hint on how to convert it to switch statement. Thank you. ...
[6 replies] Last: This is my new code and it runs perfectly fine thank you very very muc... (by MichaelBhattacharya)
WhiteSpace Replace Runtime Error
 
I'm stuck on a problem in Zybooks, the goal is to take a 2-character string input and replace any white space with an underscore. I'm pretty sure I'm on the ri...
[1 reply] : yeah it worked thanks! (by dangiannatsis93)
by mb20
Need help with comparing and incrementing values
 
-Create two clockType objects: cellPhoneClock and myComputerClock. -Prompt the user to enter the times for both clocks. -Display both times with appropria...
[no replies]
Stack: Push, Pop, Display & Search
 
Please help me alter some of my code. I feel like there are errors in the display and search functions. :( Here's my code: #include <iostream.h> #includ...
[1 reply] : @tatiannasfilthymouth, Played with your program a bit. For the most p... (by Handy Andy)
Nested for loops
 
Hi its about for loops within a for loop but I dont really understand how I can interpret it. Could someone briefly explain how I can determine what would be pr...
[3 replies] Last: var += X; // add X to var var++; // add 1 to var // is same as var... (by keskiverto)
How to make a template only for classes that have a specific function?
 
What I mean is kind of like how the for each loop only works with functions that have a begin and end function.
[1 reply] : std::enable_if This metafunction is a convenient way to leverage SF... (by JLBorges)
how to print next character in alphabet?
 
i just started learning c++ and i want to know how to print out the next character in alphabet when i input a character . i want the code to be in scanf and pri...
[4 replies] Last: #include <stdio.h> #include <string.h> #include <ctype.h> int main()... (by JLBorges)
by weee
operator[] return (&x)[i]; (1,2)
 
came across this code, couldn't understand some part first you've got this public members which look like this Vector(float _x=0, float _y=0, float _z=...
[20 replies] Last: I was referring to what OP wants to do. Namely, declare the contents o... (by helios)
how to find ''median'' in a list?
 
Hi guys, this is my second week learning c++ and i am really lost at this one: i want to make the program print out the median of the sorted list that i made. T...
[4 replies] Last: You're probably better off using the sort function but if for some re... (by mpark4656)
Queue Implementation
 
This is my implementation of Queue using singly-linked list. I've been testing this and I quite do not understand why the program crashes when I try using qual...
[4 replies] Last: Thanks again, JLBorges! (by mpark4656)
C++ Mingw
 
Write your question here. so i tried adding the directory for mingw but when i compile it gives me this error: file:///C:/mingw/mingw32/bin/ld.exe:%20cannot%2...
[4 replies] Last: Maybe try this: http://stackoverflow.com/questions/28131276/getting-no... (by closed account 48T7M4Gy)
Trying to fill a char array pointer with strings from file.
 
I am struggling with an exercise that requires you to take strings from a file, and bring them into a character pointer array, so that each element in the chara...
[3 replies] Last: Cool, thank you very much. (by centerfold)
by tbfox
Declaring variables within loops?
 
I am trying to make a simple program that will tell me the mean of a set of numbers. The problem I have is that the user must input the exact amount of numbers ...
[3 replies] Last: Of course, you don't actually need to store the numbers to get a mean.... (by cire)
Long Boolean statement shorthand?
 
I was wondering if there was a way to shorten long boolean statements like the following. if ((choice != 'w') && (choice != 's') && (choice != 'a') && (cho...
[3 replies] Last: Alternatively: const std::string valid_choices = "wsadq"; i... (by cire)
hangman with functions prototypes
 
I'm working out of a book call beginning C++ through game programming and on one of the exercises I'm suppose to remake a hangman program on the last chapter bu...
[1 reply] : Look at Line 11 and then Line 13. You declared a vector at Line 11. Y... (by mpark4656)
Not Understanding My Error
 
Hello, I am struggling to find out why the IDE says that getPlayerID (line 25) is undefined. I don't understand how it's undefined and was wondering if someone...
[12 replies] Last: Simply remove the const from int setPlayerTosses(int tosses) const ... (by Too Explosive)
need some insight
 
SO i have to add each person's final total of sum together and if it exceeds the winner then it should print out "it took number 1 - k" k being the last person...
[5 replies] Last: ahh i managed to fix it. thank you so much (by chang123)
Compounding Annual Interest on Card Balance
 
I have only been using C++ for a couple of days now. While I have experience with programming languages for recreational purposes (game design, mostly), I am n...
[no replies]
Rethrowing exception
 
Question is in the code. #include <iostream> #include <stdexcept> int main() { bool flag = true; try { try { throw std::runtime_er...
[2 replies] Last: cire Thank you for the explanation. Now I understand. (by jimbaker836)
Can I save callback functions that expect referenced variable arguments?
 
A few day ago I asked how to save a callback function in a class. Now, I don't know how to save a callback function with referenced arguments. I'll give you an ...
[9 replies] Last: "Arbitrary" in the sense that it may outlast the scope that created it... (by helios)
September 2016 Pages: 1... 3031323334
  Archived months: [aug2016] [oct2016]

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