Beginners - October 2015 (Page 18)

setw from left o_O
 
I know this is a bit of weird question but please bear with me.... I am using setw to output my details nicely and it looks somewhat like this 1 ...
[4 replies] Last: @leryss [quote=leryss]add in the setw() argument the sum of differenc... (by shadder)
Is it ok to ignore buffer after every cin?
 
I've read a few articles and forum threads about the correct way to use cin.ignore and my conclusion is that it would be a good practice to use cin.ignore (with...
[6 replies] Last: If you just discar one character that kind of format would still work... (by MiiNiPaa)
Inline Functions Question.
 
Will the compiler always insert the body of inline functions where they are called in code?
[1 reply] : No. it can decide to not to if it would hamper perfomance and provide ... (by MiiNiPaa)
Flags in ios class
 
Please explain me in what a flag is in ios class.
[1 reply] : Generally flag is a variable which signels that some event happened (f... (by MiiNiPaa)
What is a Flag
 
Please explain me what is a Flag in ios class
[1 reply] : Please, do not double post. It clutters forums and spreads attempts to... (by MiiNiPaa)
by Cat32
Need help with an error code.
 
...
[7 replies] Last: If this is the required declaration: vector<int> findMode( int data ,... (by JLBorges)
Why return a bool from an insert function?
 
I'm writing a function to insert a Node into a Tree. The assignment calls for the insert function to return a boolean. I don't understand why I should return a ...
[4 replies] Last: Ok, so there seem to be 2 cases where inserting a node can fail, there... (by Kevin C)
Help Using Set Parameters!
 
Im having a little trouble figuring out how to return more than one value through a function. Specifically one that stores 3 randomly generate numbers that can ...
[1 reply] : how to return more than one value through a function Group your varia... (by MiiNiPaa)
Need Help
 
Trying to learn C++ myself from the book and im on chapter 9 about functions. The question is... Write and test a function that takes the addresses of three d...
[4 replies] Last: That's what's commonly known as the conditional operator, although you... (by YFGHNG)
function to output values from smallest to largest
 
write the function template that receives three values and outputs them from the smallest to the largest. Can anyone spot my mistakes ? template<class T> vo...
[1 reply] : I can't see what is wrong. 1) Use a debugger 2) rewrite by using a sw... (by Kevin C)
For loop going crazy
 
I tried using cin to input name1 and name2 before but it still has the same results, but it's because I'm putting a space in between that the for loop whacks ou...
[1 reply] : getline(cin,name1); getline(cin,name2); getline(cin,gender); (by Kevin C)
Quick Logic Fix
 
Hey! I was wondering whether anyone could find the error here? The user inputs their choice and depending on their choice, they are to input which object they a...
[1 reply] : if (choice=='Y' || choice == 'y') (by Kevin C)
Functions
 
Okay so I'm completely new to functions and this was an example code provided by our instructor. To be honest I haven't learned much from it and feel totally l...
[1 reply] : http://www.programming4beginners.com/tutorial/functions/functions htt... (by Kevin C)
String in a Struct wtf
 
Why is it when I put a space when entering Person1's name the program screws up? #include <iostream> #include <string> using namespace std; int main() { st...
[1 reply] : Probably because when reading a string, the extraction operator will r... (by Kevin C)
by Obio
help help with a question about using switch structure
 
I have a question i have a assignment for class i have to write a program for a command window to output the total charges for a water bill using switch stru...
[no replies]
by dmc
cin not behaving as expected
 
Hi, I'm passing cin some erroneous input, but it's not failing as expected. The code is just: cout << "Please enter an integer: "; int n = 0; cin >...
[4 replies] Last: No it is well defined and specified by the standard. Well guess I h... (by wizebin)
by ASF93
Shopping list program have some issues
 
I am working on a program that maintain list of items. The way to do it is that I created two classes, the first is List class, the second is Items class. Obvio...
[no replies]
Copying constructor making error
 
I'm doing an assignment which building a header file of a program. I'm facing an error which cannot copy the content of original vector template<class T> ...
[1 reply] : You did not post relevant part: copy constructor. (and assigment opera... (by MiiNiPaa)
by st4evr
Number Guessing Game Using Void and For Loop
 
Hello, Beginner C++ student here, first ever programming class. I am studying the code below for a number guessing game using a for loop and void function. H...
[2 replies] Last: Thank you. Made that correction and a couple of other modifications an... (by st4evr)
trying to write into the inputFile.
 
How do i go about passing the char from loadDataFromFile to my int main? I tried doing it like this int main(char fileName ), but i am getting this error Un...
[6 replies] Last: The warning level is whatever VB sets it as. I know that it my issue i... (by Hidden Squid)
October 2015 Pages: 1... 1617181920... 57
  Archived months: [sep2015] [nov2015]

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