Beginners - September 2012 (Page 25)

Help with templates
 
Hey c++ forums, I have been learning templates but the problem is that i do not know how to set it out. If any of you programmers know how to make one show me...
[1 reply] : template <typename> struct A {}; int main() { A<int> a; } ... (by vlad from moscow)
by Triea
Merging program
 
I am new to C++, and due to scheduling problems I've missed the first week of class and the lessons I needed to understand how to do the work we've been assigne...
[6 replies] Last: Alright, I ended up fixing the program and now it reads in both lists ... (by Triea)
Display Days in a Month including leap year
 
I'm new to programming and am taking a class in school. Our assignment is to display the day in a month taking into account leap years. This is what I have so f...
[3 replies] Last: the use of the ternary operator is not correct. His usage was entir... (by cire)
by KStim
Adding characters after the cin object
 
How do you add a character after the user input? For example i have an assignment involving loan calculations and my cin looks like this cout << "Please in...
[4 replies] Last: Yes, mine or kevin's examples work, use mine if you want the variable ... (by closed account N36fSL3A)
first game seriously need help what to start learning
 
ok so i am totally newbie on every language so i need bit help what to use. so me and 3 my friends were going to make a free world mmorpg on cryengine.... =D ...
[no replies]
nested if else statements
 
As I came across difficulty on how to write nested if else statements. Please some can help me to give a tips for that. here is the programme i wrote. but it do...
[1 reply] : // question 1 #include <iostream> using namespace std ; int main() ... (by Texan40)
by Gyova
help
 
hello everyone! i'm new in studying c++ and i'm a bit geting confused :( #include<iostream> #include<istream> using namespace std; int main() { int b; ...
[7 replies] Last: Thank you @chipp (by Gyova)
How to do 50/50 chance of a number
 
I am doing a Plinko program and when you drop a chip in, it has a 50/50 shot at either going left or right(which correspond to numbers such as 3.5 or 4). How w...
[3 replies] Last: Errr... why should you add 1 to it? That just makes it more complicat... (by Disch)
by ChetZ
Why is this a leak?
 
Hello, While checking for leaks in my code I was directed to: Node* &son = this->sons where Node is the following object: class Node{ public: ...
[9 replies] Last: I thought that you've got a non-directed graph. So A is neighbour of B... (by ne555)
Displaying numbers that are multiples of...
 
Hi, I'm taking a C++ programming course and I'm having a problem completing one of the assignments. The requirements are 1) Ask the user to enter a numbe...
[4 replies] Last: if (mul==0) Will almost always fail, mul is a double. (by TheIdeasMan)
C++ Variance and Standard Deviation
 
I have to write a program to calculate sum, mean, variance, and standard deviation and I was able to do the sum and mean but I don't understand the variance and...
[1 reply] : you can use for loop for calculating variance, it's very simple: f... (by chipp)
program help
 
how do i write this program? Write a program in which the main() function 1. Accepts an integer number from the user, N. Generates N random numbers between 0 an...
[1 reply] : Have you done anything at all? We won't do your homework for you - sh... (by TheIdeasMan)
Help with math formula
 
Hi This site seems like an amazing C++ resource. I am currently a beginner and I am coding my first project. I need to print the following formula, in basic ...
[5 replies] Last: Also, be careful with floating point numbers and comparisons. These nu... (by TheIdeasMan)
getline problem
 
Why this program cannot record to text file the second inputted data. only the were stored in the text file...please help #include<iostream> #include<fstrea...
[5 replies] Last: use cin.ignore() is better . to clear the buffer cin.ignore(); //cl... (by BasicNewbie)
sort function issue - backwards?
 
I don't know if posting my entire code is necessary but will do so in the event that it may be needed. This sortWords function is sorting backwards and it is r...
[3 replies] Last: Oh and I fixed the counter for lines too! Thank you for the assistanc... (by badkaykay)
Write a program that reads in a length in feet and inches and outputs the equivalent
 
Write a program that reads in a length in feet and inches and outputs the equivalent length in meters and centimeters. Use multiple functions: MAIN, HSKP, R...
[5 replies] Last: Here, we tend not to outright do people's homework for them. If you do... (by Moschops)
Break statement not within loop or switch
 
I know it must be something really stupid, but I can't figure it out. while (!(cin >> onFeat)); { cin.clear(); char ch; cin.get(...
[6 replies] Last: here break statement is never reached because of the continue statemen... (by rahuljain983)
Scott Meyers: Item 7, new operator exception handling
 
Hi Guys, I'm working through Scott Meyer's Effective C++ and I am on Item 7, which is exception handling for the new operator. I've implemented his exampl...
[3 replies] Last: To test your code, just force an ::operator new() failure. For insta... (by JLBorges)
Polynomial Arithmetic
 
What is Polynomial Arithmetic? Please give me an example about Polynomial Arithmetic (Script in C++). I got a task and I don't know how I start writing script.
[5 replies] Last: I know what you mean. Thanks before, Sir. I don't lazy to read or sea... (by zhumpex)
Why does it skip my 'getline'?
 
I'm trying to make a menu with multiple choices, but when it get's to my getline(cin, Bar) it just skips this and jumps to the next line in code. What am I d...
[4 replies] Last: The following code works fine. It waits for the user to type something... (by Moschops)
September 2012 Pages: 1... 2324252627... 62
  Archived months: [aug2012] [oct2012]

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