General C++ Programming - April 2017

need help with this simple structures program.
 
im trying to write a program using structures. there will be 2 movies. user will input information, and program will ouput it back. the problem : it runs fine ...
[1 reply] : MovieData movie2; cin.ignore(); cout << "Enter title of movie.\n"; ... (by thepizzaisaggressive)
initiliazing object array
 
I want to initialize an object array from another class with the default constructor, is it possible? and how? here's what I've done, but I'm getting an er...
[3 replies] Last: You can't initialize an array like that after declaring it. Edit: ... (by TarikNeaj)
Quick question
 
I have this question on a C++ assignment and I have no idea what it means. “Is-A” and “Has-A” are common vernacular for what kind of relationships betw...
[3 replies] Last: c++ does not recognize "lines". C++ can have the entire program on o... (by jonnin)
Unexpected result, Cant find the error
 
int main() { double rainfall ; double total = 0; double avg = 0; double maxRain = 0; double minRain = 0; double tempRain = 0; ...
[3 replies] Last: Thank you guys! (by chris213)
I NEED INFORMATION (PLEASE) ABOUT ARRAYS AND FORMULAS
 
*** I am a beginner and I don't know why the answer for the class standing is 0. Is there something wrong with my formula? I've researched a lot. I really can't...
[3 replies] Last: I could not compile it, not sure what the problem is but I recommend r... (by benhart)
binary trees - Preorder - Inorder
 
hello guys, i am in a desperate position atm...i "killed" google search engine trying finding a class token and binary tree combine in order to evaluate a preOr...
[2 replies] Last: yeah i know ... the above code i fegure it out on my own... but what a... (by cotsios17)
Template does not compile
 
// Count sequentially equal elements for both arrays from the start: namespace Detail { // Not equal, stop and give result: template<class Type, class Checked...
[2 replies] Last: Oh, that's my bad. I have used "class" specifier instead of "typename"... (by Krogoth)
Bus Error Without Direct Addressing
 
Hi all, I'm getting a bus error when calling the function below with a taxableIncome < taxCap[cod'e'] . (EX: calcTaxAmt(1, 3000);) Offending function: float ...
[1 reply] : In the example call you gave (i.e., calcTaxAmt(1, 3000); ), the loop ... (by mbozzi)
page handler
 
I have been creating a game on c++ for a few months now and have had quite a bit of help form my teacher and fellow c++ programmers, and hi have been told my sc...
[5 replies] Last: theIdeasMan is there a way i can avoid global variables? (by OneShot)
bookType Class problem using ADT
 
I am very overwhelmed and just need help starting out a solution. I received this main program along with instructions: javascript:tx(' #include <iostream> #...
[no replies]
How to return a string from what() properly?
 
Hello everyone! I'm dealing with a very weird issue. I have created a program that uses exceptions heavily to report errors to the user. Most exceptions come w...
[4 replies] Last: This looks really good, I think I'll go with that. Thanks a lot! (by Register)
I'm behind and need IMMEDIATE help
 
So I'm at a loss for my current assignment. I've missed some classes and so I've lost my knowledge on how to go about it but basically the problem is this. C...
[7 replies] Last: welp pause wasn't needed. Anyway I figured it out thanks a bunch. (by ZRAIARZ)
Dealing with buffers in a game server.
 
I'm designing a game server (using asio) which is suppose to handle a large number of small messages (game updates). The server's role is simply to pass mess...
[7 replies] Last: I'm not clear on why you can't fully read the input stream My stream... (by zoran404)
by F95
Urgent! Need help assigning a hash value to text in a hashtable
 
I need help writing a program in Visual Studio that accesses a .txt file, which has to be read from the .cpp in int main() (as I have it doing so) and then assi...
[10 replies] Last: I made some major changes to my code and finally got it to do what I w... (by F95)
compile error help no member function declared in class
 
CS162prog4.cpp:17:28: error: no ‘void Subject_List::display()’ member function declared in class ‘Subject_List’ void Subject_List::display() ...
[3 replies] Last: Thanks for the answer, I think I know what happened to create the outd... (by esjastad)
test scores #1
 
book question: Write a program that dynamically allocates an array large enough to hold a user-defined number of test scores. Once all the scores are entered,...
[5 replies] Last: #include <iostream> #include <iomanip> using namespace std; void sh... (by moon14)
creating vector or array with different names in a loop
 
Hi I'm trying to loop this for(int i = 0; i <3; i++){ string a = "desc"; char counter1 ; itoa(i,counter1,10); a += counter1;// the name that s...
[3 replies] Last: thanks a lot. this would get the job done. (by mehdicpp)
by Pirkk
set std::map value from within function without deleting on return
 
So let's say we have this code: std::map<std::string, SomeClass> exampleMap; void addToExampleMap() { exampleMap["foo"] = SomeClass(); } int main() { ad...
[2 replies] Last: You're right I'm sped. I was doing something really weird. Thanks for ... (by Pirkk)
new guy is probably WAY over his head...
 
Hi, just joined and have been using the tutorials on this site to help me get started. I'm trying to make a program that asks you for drawing scale for archite...
[5 replies] Last: I don't want it to be THAT insecure... The real issue with std::sys... (by mbozzi)
pay c++
 
teacher program notes: Create a UML diagram for the following class and then create the following class and demo program. Submit the UML diagram, the class f...
[1 reply] : I noticed I wasn't exactly going how my teacher wanted. header file: ... (by kohl5555)
April 2017 Pages: 123... 16
  Archived months: [mar2017] [may2017]

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