Beginners - February 2015 (Page 29)

NEED HELP...Please
 
So my teacher wants us to print user input amount of asterisks, but then he also wants us to separate them into user input amount of groups. I am already able t...
[3 replies] Last: for ( int j = 0; j < groupAsterisk; j++ ) { for ( int k = 0; k < ... (by Mr D)
Small question about classes
 
i am looking at code for a custom vector class and i see something like this ClassName a; ClassName d{5}; cout<< d what is {5} and what the...
[2 replies] Last: thanks just starting to learn all the new featured on c++11 (by pel1993)
infinite loop
 
I am getting an infinite loop for some reason. It should just read until the end of the line but for some reason it reads the entire file then hits an infinite ...
[2 replies] Last: Thanks for the input but I figured it out I need temp = infile.get (by mtbrooks1993)
by kiri
Only returns first line on while loop
 
I do not know why it does not finish reading the dat file. Any idea? #include <iostream> #include <fstream> #include <string> #include <iomanip> using namesp...
[12 replies] Last: u r so wise LB......as always :-/ (by kiri)
Question about fstream?
 
Can some one explain to me in less complex terms and maybe give an example of what fstream is and what it is used for. Im curious if its telling me how to ins...
[5 replies] Last: I apologize, that is what i meant. It creates a file when you attempt ... (by Mr D)
Nodes
 
So I want to create a two-dimensional array full of nodes as a map to be navigated through. I'm new to nodes and unsure of how to do this, although I have the g...
[11 replies] Last: Bump (by Mr D)
Dynamic Matrix
 
Hi,i want to delete from dynamic matrix the first row, where the sum of the elements is more than 10. Here is my code. Why doesn't it work properly? When it fi...
[2 replies] Last: thank you (by programmer0)
by HelenI
Postfix expression evaluation
 
Hello there!! I have to solve a postfix expression evaluation. e.g. : 7 4 -3 * 1 5 + / * the answer is -14 my code is always printing 55.... i need help. ...
[no replies]
BMI help
 
I get an error at the return line can someone help? int main() { int feet; float inches, height, weight, BMI; cout<<"BMI Calculator"<<endl; ...
[2 replies] Last: please use code tags <> (by anup30)
by Nis
Please help explain these errors
 
I cannot figure out where I went wrong here. Please help #include <iostream> #include <string> using namespace std; class student { private: ...
[4 replies] Last: if it has to be void It has to be int, not void. What is missing fr... (by MiiNiPaa)
by id10t
Stupid Class/Object Initialization Question
 
I have what I assume is a very stupid/simple question regarding arrays. Yes, this is a homework assignment for a second semester programming class (1st semester...
[4 replies] Last: Thanks again LB. I think I understand what I was doing wrong but I'm n... (by id10t)
by GilTea
Issue with IF statement / Array / While loop
 
Hi there, I am fairly new to C++ and am only asking for a bit of direction, not to have code created for me. I have written a program that allows one to enter ...
[4 replies] Last: You're a gentleman and a scholar, thanks Anon. (by GilTea)
Mean above mean
 
I need to make a program that reads in a list of floating-point numbers then calculates and displays the mean value for all values greater than the mean using a...
[12 replies] Last: bump (by keltonfan2)
Wrong output
 
// t is the number of test cases. When I input t, I get a output of 0 first. Then I am asked to enter the strings 2 times as there are 2 test cases. The...
[4 replies] Last: How can I calculate the total number of characters entered into the s... (by MiiNiPaa)
Program not outputting correctly
 
I have to create a program that the user enters the input for three sides of a triangle and the output tells me whether it is a right triangle or not. The issue...
[1 reply] : Never mind, I ended up figuring it out. It was because I didn't use ==... (by fukonashi)
Character string input
 
I want to input a string whose maximum length could be pow(10,5). And input into the string must be terminated when a newline is recognised. How can I calcu...
[no replies]
by Kernul
Put an element in a sorted vector
 
Given a sorted vector V and an element a, put the element a into the vector keeping the vector sorted. Example: INPUT [3 24 88] 55 OUTPUT [3 24 55 88] EDIT: ...
[6 replies] Last: To find the position I have to find the first number that is bigger th... (by Kernul)
assignment operator overloading
 
class ABC{ int i; public: ABC(int ii):i(ii){} // copy-ctor ABC(const ABC& obj) { i+=obj.i; } // assignment operator...
[4 replies] Last: > why does (i=j).modify(); work? > Also, ((i=j)=k); should not support... (by JLBorges)
Why constexpr template functions would work?
 
Hi guys, I had this question thrust into my head, why constexpr template functions would work? As shown in the code below, it is a constexpr template function w...
[3 replies] Last: Thanks for your replies. Really appreciate it! (by glenjoker)
matrix vertically reconfigurated array elements
 
can somebody please fix it so as to output : a= 1 5 9 2 6 10 3 7 11 4 8 12 #include <iostream> #include <stdlib.h> #include <iomanip> using nam...
[3 replies] Last: more array reconfigurations #include <iostream> #include <iomanip> ... (by mynicks)
February 2015 Pages: 1... 2728293031... 52
  Archived months: [jan2015] [mar2015]

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