General C++ Programming - January 2017 (Page 4)

Multiple Template Inheritance
 
Hello. I'm having troubles with this problem: I Have a template class, named "HashMap" , which includes, in its public area an inner class named "Hashable...
[10 replies] Last: What if I MUST use an inner class (public) and use it exactly how i w... (by mbozzi)
URGENT c++ bug; string manipulation
 
Hi all, the code below is intended to remove all punctuation from the user input, and then print the strings back to the user. However, in my code, when putting...
[2 replies] Last: seems punctuation is the topic du jour - check this out http://www.cpl... (by gunnerfunner)
acos not working properly
 
Hey, I'm writing a programm to create some random triangles and after creating the lengths a,b and c (a+b > c && a < c && b < c) i want to get the angles with ...
[2 replies] Last: Thank you for the quick answer! Perfect (by DuckyDuck)
Files Not Working
 
Hello Everyone, The Files Used In This Program Accepts Contents But Doesn't Display Them, Any Idea Why? #include<iostream.h> #include<conio.h> #include<strin...
[7 replies] Last: Hmm, the funny thing is that the original pdf that this was taken from... (by newbieg)
by Fitter
Structure of Switch code
 
I have problems with a function involving switch statements: // Read in message from slave(s) confirming the completion of tasks. void confirmCompletion() {...
[2 replies] Last: Thanks for that cire . Leaving out 'break' ! Aaaaarrrrrggggh!!... (by Fitter)
Program for x^y with negative powers
 
#include <iostream> #include <cstdlib> using namespace std; float power(float,int); int main() { float base; int exponent; float result; cout<<...
[2 replies] Last: Your problem is that you never use the p value, but instead you use th... (by Golden Lizard)
by wawzky
FILE HANDLING: Bug in displaying the name and date of birth. How to fix this?
 
#include <iostream> #include <fstream> #include <conio.h> #include <cstring> using namespace std; class crim_rec { char name ; char sex; char fathr_na...
[3 replies] Last: "I have trouble formatting my output..." // Here's 240 lines of irr... (by cire)
How operations invalidate iterators - couple of doubts...
 
Hi, Lippman's C++ Primer 5th edition states: "After an operation that adds elements to a container: 1) iterators, pointers and references (including the ...
[4 replies] Last: Thanks a lot!! Great answers helios!! Juan Dent (by JUAN DENT)
singly linked list problem
 
#include<iostream> #include<cstdio> #include<cstdlib> #include <string> #include <cstring> using namespace std; /* * Node Declaration */ struct node ...
[3 replies] Last: Thanks man i did some changing ,now my code is complete check it out .... (by Hamxa1994)
quadratic assignment problem
 
i got this coding but i cannot run it because of localserver.h, then i search for it and found but, but it doesn't run either..does anyone here know about local...
[1 reply] : http://www.cplusplus.com/forum/beginner/206956/ (by TheIdeasMan)
by SCB3
Stuck on adding costs to Nodes (Pathfinding)
 
At the moment I am trying to work out the A Star Pathfinding Algorithm. Where I'm stuck is the following: Assigning a 'Cost' to each node - I have a text file...
[6 replies] Last: Ah ok, I did managed another method to populate the map which now work... (by SCB3)
by youngc
I am having trouble with my program running
 
For school, for a project I worked in three separate files for creating it and when I got everything together the program runs but crashes at a certain point. C...
[4 replies] Last: Thank you so much changing int to string worked perfectly. Thanks Agai... (by youngc)
Strange allocation bug
 
My goal here is to read characters from std::cin and store it in an allocated array until an '!' is read. My code works just fine until I reach about 8 charact...
[4 replies] Last: My question now is, why did it work with the first few characters? ... (by dhayden)
Have you any smarter way to achieve this file
 
Hi all. I should like to avoid adding 9999 at the end of the list. Perhaps using ENTER as CR and validation in the same time (that is only one hit at the end o...
[7 replies] Last: To Chervil. Fantastic and smart. Your file works very well. It is very... (by sylvain)
Book class for PPP2 - Help Needed (1,2)
 
For PPP2, I have to write a class Book. It spans exercises 5 through 9 in Chapter 9 and I've just started Exercise 5. Here are the specifications: This exer...
[20 replies] Last: Okay, never mind. I found out that the Library class instance has to ... (by DragonOsman)
by Ekinne
fraction numbers
 
Write a c++ program to display a message if the number entered is whole or fraction number when the user enters a whole number or a fractional number. Pls help ...
[1 reply] : duplicate: http://www.cplusplus.com/forum/beginner/206920/ (by Chervil)
Handle Exception Error
 
Good afternoon, I am working on a program that read a csv file and then generate a csv file as an output. I got the following error: Exception thrown at 0x...
[2 replies] Last: You also need to check that the file contains all those fields: ... (by Chervil)
Counting numbers within a Vector
 
Hi, Can someone tell me what I'm doing wrong here? It's almost like the declared integer variables aren't recognised within the "for_each" routine. Compiler gi...
[12 replies] Last: Thanks, Coder777, that is what was missing. All the other solutions p... (by Thunderchook)
by Previn
Need help reading a file?
 
Hi everyone, I am assigned to create a program that reads from a list of people. The list is in the following order: last name, first name SSN age street addr...
[2 replies] Last: There's a small problem with SamuelAdams' code. The inputfile stream... (by MZH)
need help with loop
 
Question: i have this do while loop for when i enter a number. right now i have the value of 10 to quit the loop but that was only temporary to see if my proj...
[3 replies] Last: The easiest way is to use break in order to jump out of a while(tru... (by MZH)
January 2017 Pages: 123456... 13
  Archived months: [dec2016] [feb2017]

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