General C++ Programming - November 2014 (Page 27)

Sort vector of pointers to objects
 
Im creating a program for a race. The Race class has a vector of results and each element of that vector is a pointer to a result. The Result class has a Time a...
[9 replies] Last: Yes that solved all the problems! Thank you very much! (by ricardo46)
by kramo
Need assistance. How to square and cube a file or something
 
the problem is Write a program that reads in a text file named “my_input.txt” that contains characters composed of digits, letters and other symbols. Then...
[no replies]
by embear
help with card shuffling please!!
 
hi, im trying to shuffle a deck of cards, and it keeps coming out in order. I have no idea what i'm doing wrong, please help! #include <iostream> #include <str...
[2 replies] Last: also int j was not being used (by jasonwynn10)
Issues
 
. For a given array, find the maximum value and the position of this maximum value in the array a. Create a function to find the position of the max value in...
[no replies]
Not sure what I am doing wrong here
 
#include <iostream> using namespace std; void checkLines(double slope1, double slope2) { if (slope1 = slope2) { cout << "\n Your slopes are parallel...
[2 replies] Last: Please use code brackes Fixed: #include <iostream> using namespace st... (by jasonwynn10)
How to make sentence a new paragraph in c++ text file
 
I am writing my code here..I have to modify my output text file and convert every sentence into paragraph. I ran it its copying whole text but not paragraph aft...
[2 replies] Last: I thing getline is bettern than get #include <iostream> #include <fs... (by SreeB)
by kww228
Help with errors
 
Hello all I am new to C++ and I am having a few errors when compiling my code for class. The point of the program is to overload the different operators. The ...
[5 replies] Last: $ cat fractionType.h #ifndef FRACTIONTYPE_H_INCLUDED #define FRACTI... (by SreeB)
Collision Methods
 
I was curious about collision methods and the pros and cons for each one. Here's a list of collision methods rehashing,linear,quadratic, and open chaining.
[no replies]
Program Help using a template
 
I need to figure out how to get this program to allow you to input integers and characters. Right now it only allows integers. I have the char commented out. I ...
[no replies]
About operator >>
 
Hello everyone! I'm just a beginner at C++ and I want to ask about this problems: In C we can use scanf("%d / %d / %d", &mm, &dd, &yyyy) to get multiple va...
[7 replies] Last: > What are the differences between ios::setstate and ios::clear std:... (by JLBorges)
Using arrays to store information
 
I am trying to use an array to keep track of the numbers of channels created and how many times a particular channel has been copied. At the moment, the program...
[1 reply] : Or, you can simply check for the _C# suffix. It will work as well if ... (by S G H)
Obtaining an operator from compile-time constant?
 
I want to generalize my productFunction below to a template family of functions where the template merely changes the * to + or whatever else operator I wish to...
[3 replies] Last: @exchgg. Please respond, since you don't accept private messages. I ... (by prestokeys)
Linked List Substrings
 
Hi having trouble with this homework assignment and hopefully a fresh pair of eyes can see where I went wrong in this assignment. So the assignment is that give...
[2 replies] Last: @kbw That code does not work for what I need to do, it is suppose to ... (by MajorLeeHung)
Homework help needed
 
The question is Create a counting program that counts backward from 100 to 1 in increments of 10. #include <iostream> using namespace std; int main() ...
[1 reply] : you are counting backwards so why are you adding 10 on line 8? and ... (by mutexe)
2 dimensional vector represented as a class
 
Hello, I have to create a class to represent a 2 dimensional vector. I need to include certain member functions such as a function to find magnitude of the ...
[1 reply] : By "2D vector" you mean something like: http://qt-project.org/doc/qt-5... (by keskiverto)
returning values to main
 
I am working on this program below. The problem I am having is trying to return totalDays to the main. In the numOfDays() function there is a for loop that adds...
[2 replies] Last: thanks (by jonmackey22)
Functions
 
Hello, first time poster and begginer coding. Basically, my program below isn't storing and returning the values I need in order to continue into the next funct...
[2 replies] Last: Thank you!!!! It works perfectly now! (by awinborn)
bad allocation error
 
The code below is giving me a bad allocation error, I think it may be due to the size which is 4294965747. char * array = new char Where am I going wr...
[7 replies] Last: No matter what, he is not going to have 4GB array. Deque is as close ... (by Avilius)
help with arrays ..
 
hi guys.. so this is my code ,,and i wish if someone could tell me why the output give the same result for calculating the hypotenuse of a right triangle ev...
[4 replies] Last: i give up.. thanks anyway (by deepestblue)
C++ Assignment help
 
Hi all. I am fairly new to programming. so I need a little help. I was given this assignment today and can't seem to figure out what I am doing wrong. Here is t...
[8 replies] Last: Exactly!!!! Nice job. Now you just need to write the main program wh... (by dhayden)
November 2014 Pages: 1... 2526272829... 32
  Archived months: [oct2014] [dec2014]

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