Beginners - July 2017 (Page 6)

Vector Function
 
This program isn't done, I know I'm just making a simple mistake. As you see in the void function from Lines 13-26, essentially I want the loop to be able print...
[2 replies] Last: @dhayden OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO, I just forgot,... (by portpabs)
A small problem with C++ stream manipulators
 
i need to make a stream manipulator which takes a number and multiplies it by (-1),something like this: #include <iostream> using namespace std; void ...
[1 reply] : A somewhat limited version of the output stream manipulator negative ... (by JLBorges)
Lower bound works as an upper bound ..
 
this outputs 15 not 7 #include<iostream> #include<algorithm> using namespace std; int main(){ int a = {7,15}; cout<<a[lower_bound(a,a+2,10)-a]<...
[4 replies] Last: #include <iostream> #include <algorithm> #include <iterator> int mai... (by JLBorges)
Tic Tac Toe converting '.' to " " in readfile
 
Ok, I am trying to solve this super small error and I cannot figure it out. In this program you would read a board into a 2D array (this is the practice). The f...
[11 replies] Last: I just had another look at your original code which I didn't look at a... (by closed account 48T7M4Gy)
What is void*?
 
What is a void*? What are its uses(I saw something regarding interfaces)?
[2 replies] Last: you see it in threading still, where the args to the thread function ... (by jonnin)
Prototyping advise on conditions
 
P,s(Was written on a android phone mobile c use (so might look wrong if copy and pasted. ) Hi I'm building a Test like, exam type based program( something li...
[9 replies] Last: Thanks masters: need to learn casting expressions now. What exactly ... (by jlb)
blank in cin
 
How can a user ignore a cin.Like enter nothing in a particular line where value is asked.
[1 reply] : cin already ignores whitespace for normal (>>) usage. So it will giv... (by jonnin)
Nested class
 
I am really struggling with nested classes and i wrote this program but lots of errors since i havent done it before. #include<iostream> using namespace ...
[1 reply] : Lines 12-13,22,26: get() and out() are not typed. Lines 17-18, 30,35... (by AbstractionAnon)
by Dmtg93
Reversing functions
 
So for my last assignment I need to reverse the order of an array without creating another array. I have the header void reverse (int arr ,int length) So...
[7 replies] Last: Agreed; it looks to me like it's directing the OP to limit the functio... (by MikeyBoy)
Need help with User-Defined Functions and Looping
 
My professor gave us an assignment to work out a payroll program that takes in data from a file, then outputs the payroll information in one file and the errors...
[12 replies] Last: Oh thank you so much! I didnt even realize I had them in different ord... (by dansparce)
C++ what is a while loop to allow the user accept values until a limit is reached?
 
The result should be: Accepting donations till we reach $100 Enter donation, or zero for no donation: 12 Enter donation, or zero for no donation: 10 En...
[4 replies] Last: #include <iostream> using namespace std; int main() { int donat... (by closed account 48T7M4Gy)
Skip 3 lines from a file while storing into array
 
I'm doing an assignment for school and I'm stuck. From the following .txt file: John 100 99 100 Julio 88.5 80.5 85 Johnathan 70 83.5 86 Julia 80.5...
[4 replies] Last: As already suggested, one of many possible variants: //Help on this p... (by closed account 48T7M4Gy)
What is the name of this sorting algorithm ?
 
for (int i = 0; i < arr.size() - 1; ++i) { if (arr.at(i) > arr.at(i + 1)) { std::swap(arr.at(i), arr.at(i + 1)); } } For quite some ti...
[6 replies] Last: the perfect sort is bucket, which only works on integers really, thoug... (by jonnin)
by Tobruk
extern const int used as array size - expression must be constant error
 
I declare and initialize this constant in globals.cpp: const unsigned SETT_OPTION_COUNT=4; To make it accessible from other files, I make the const extern in ...
[3 replies] Last: Thank you both kindly for your replies. It solved the problem :) (by Tobruk)
by Manel
How can I use C++ on my site
 
Hi! it's a forum for beginners and that is why I have the courage to ask this question...:) How can I use C++ on my website? Is it at all to use on websites? ...
[2 replies] Last: thank you very much for your help! (by Manel)
How do I pass structure to function with pointers and reference ?
 
How do I pass structure to function with pointers and reference ?
[2 replies] Last: Like this: struct YourStruct { // some data members }; // Using p... (by Thomas1965)
Quiz show reset
 
Hello! I need some help with reseting the highscore on the quizshow. the reset program must have: If the user answers 'y', Reset.exe resets the high scores list...
[9 replies] Last: OMG... I have been overthinking this now that I have figured it out! T... (by suna6382)
Question: Does calling an element of an array by its index require parsing the entire array?
 
Does calling an element of an array by its index require parsing the entire array?
[3 replies] Last: No. The computer finds the address of the element by doing some arithm... (by dhayden)
by bblotz
Display message with double?
 
I need to display an error message when the GPA is outside the bounds of 0.0 < gpa < 4.0 (so like gpa = 5.0) however I am not sure how to do this since my varia...
[3 replies] Last: Array as a global variable? Rethink about that. Globals, like dark sid... (by keskiverto)
by bblotz
seat reservation program
 
Hello, I am trying to complete this code. The object is to write a program that can reserve seats (like a movie theater) using a two-dimensional array. The user...
[2 replies] Last: Thank you very much, I understand now what needed to be done. :) (by bblotz)
July 2017 Pages: 1... 45678... 12
  Archived months: [jun2017] [aug2017]

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