General C++ Programming - March 2015 (Page 22)

Matrix Class Error
 
Hello all, this is my first time of using cpluscplus, nice to meet you all. I am writing a matrix class that overloads assignments,addition, subtraction...etc....
[2 replies] Last: Hello LB Thanks I realised that yesterday and now it is solved, thank... (by nocod123)
Stream Read Buffer Content
 
Hi, I'm new to the forum, but I've been referencing this websites forum for help with my program. I have a large data file with 2 million lines, containing a re...
[12 replies] Last: Try: #include <iostream> #include <fstream> #include <chrono> #includ... (by JLBorges)
File Output
 
I am creating a program reads a name from a text file "text.txt" loaded as a cstring. It will then create a file "other/namefromtext.tot". How would I go about...
[8 replies] Last: ok, that solves my problem entirely thank you. (by lordseanington)
by Ugan93
question about while loop and for loop.
 
Write your question here. here i have question and i really dont know to do.. confusing. write a complete code that will fill while loop and for loop num wi...
[8 replies] Last: Why do you care if the user enters anything other than 'Y' ? You give... (by LB)
How do I calculate and return the value of pointer to max element?
 
I'm Having extreme difficulties with this question. Here is what i have coded, but it wont work. These are the instructions. TO DO: Insert code here to calculat...
[1 reply] : Please edit your post and make sure your code is [co de]between code ... (by LB)
Decimal to Binary conversion (16-bit)
 
I need help with a C++ programming problem, for some reason I can't even think of a way to start on this problem. Any help would be greatly appreciated. Also, n...
[3 replies] Last: Digits in binary have a "weight" of 2 n , where n is the bit number. ... (by Disch)
my little game and still a bit new to classes and how to access one class from another
 
alright I have a class for shooting(shots) in my game, also a player, map and game class. so I have the player creating the shots with void Player::shoo...
[6 replies] Last: thank u I did get it to start working, now the tough part of getting t... (by morngrym)
How to pass a non static function as argument
 
How to pass a non static function as argument? struct A{ void a(void b()){ b(); } }; struct B{ void b(){} B(){ A a; a.a(b...
[1 reply] : Use std::function and keep in mind that an extra first argument is a... (by LB)
string::compare not working?
 
I don't know if I'm using string::compare right.. I am using insertion sort to sort some records that contain a population, city, and state. Population works fi...
[9 replies] Last: Found the error.. I didn't have an = operator after while(j >= ...) (by namesjj)
2147483647 maximum integer
 
How do I use a vector to store a number that's bigger than 2147483647? I'm reading in an insanely large number and manipulating the digits. When the user input ...
[6 replies] Last: @pattrick128 Instead of reading the numbers into a vector<int> and the... (by naraku9333)
by jhunge
Find the word with most vowel, and the word with most consonant
 
Write a program that ask for a long string and determine the word with the most number of vowel and most number of consonants example: the quick brown fox ju...
[5 replies] Last: You should use std::getline instead of that strange while loop const... (by LB)
How can i call the data type from the function of a class
 
Hello, everyone. I defined a class as well as member function. And now i would like to call the data type(x.dat) imported from outside. how could I do that? Tha...
[1 reply] : I'm not sure what you mean? Could you try rephrasing or providing a be... (by LB)
writing reduce function more efficiently
 
Hi I was wondering how I could re write this code so it will make my program more efficient and it will also be able to account for negative numerators (my prog...
[6 replies] Last: Yes, what I asked you to try was editing the size of the numerator and... (by Militie)
Help on Programmning
 
Use object oriented design to create a movie class that contains private data for title, profits, a rating, and a review. Next create a theater class com...
[2 replies] Last: Thank you very much! (by closed account jihpDjzh)
Saving the most recent objects to avoid memory overflow
 
The goal here is to only save the most recent Objects created if maxMemoryOfObjects is exceeded. But the way I'm doing it ironically adds more memory to the Ob...
[3 replies] Last: I think there is a difference between our uses of the word "save" - to... (by LB)
Cavity map
 
This is a coding question on Hackerrank. We're given a bunch of strings of ints, say 1112, 1234, and 1842. If a certain digit in the string is bigger than b...
[2 replies] Last: I ran into another problem, actually. //loop through each ... (by pattrick128)
C++ Prefix Average Conversion
 
I was givin this function to convert to c++ code but i dont understand how to convert the first step a <- new array, i believe i have the rest correct. Any help...
[3 replies] Last: Ahhh, i see. Thank you, now i understand :) (by hoofhamples)
infile homework help.
 
Hello, I have a program for class that performs various arithmetic operations including: addition, subtraction, multiplication, division, exponents, and factor...
[no replies]
Help
 
how can I display my 20 random numbers array into a 80 element array that has been initialized to zero. #include <iostream> #include <cstdlib> using names...
[no replies]
by ajg55
istream parameter question
 
For a class project, my professor wanted us to use extern Token getToken(istream *br, string& lexeme); The getToken() function is implemented in anothe...
[4 replies] Last: Ah, I missed that the header could not be changed. In that case, you j... (by LB)
March 2015 Pages: 1... 2021222324... 28
  Archived months: [feb2015] [apr2015]

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