General C++ Programming - October 2016

by mvgnum
Class Redefinition
 
#include<iostream> using namespace std; class Vehicle { int position; public: virtual void setV(int pos) { position = pos; ...
[1 reply] : Use include guards. https://en.wikipedia.org/wiki/Include_guard (by Peter87)
User defined functions and repetition
 
I need to create a program using user defined functions and repetition. The program should show a halloween related message each time the user continues. This i...
[no replies]
mapvirtualkey question
 
Hi i'm trying to show unicode text of my keys but i always get values between 1 and 0 when is some key pressed in keyboard state. Some way to get unicode text? ...
[no replies]
Resizing a BMP image in C
 
I need to resize a BMP image in C for a homework problem. I've already written the code for resizing them horizontally, but am having trouble with the vertical ...
[no replies]
Binary search template to class
 
So far i can do basic template binary search to any type. But i'm stuck when i have to search for objects. I don't know which operator shall i overload to make ...
[1 reply] : Your bsearch function returns T and then you have a statment return -1... (by gunnerfunner)
Access Violation
 
I have been trying to track down this segmentation fault and I just can't seem to find it. I feel bad pasting so much code but I have been at this for upwards o...
[6 replies] Last: > I excluded the header and main because they were not important to so... (by ne555)
How to delete garbage
 
Hi, i'm working on a little OpenGL Project and i noticed that i have a lot of garbage on the stack when the program is done. So i could find most of it an...
[1 reply] : I'm sorry. Delete it? Garbage is garbage. You can't perform any meanin... (by helios)
Map Game never ending loop
 
im in a beginners course for c++ and the assignment is to make a map game where it gets the info from an outfile. I know ive made a mistake somewhere because it...
[1 reply] : In routine void fileProcess() you set up a while loop: while(dSelec... (by lastchance)
Problem in Coding Basic Arithmetic Calculator using Functions and Switch
 
what is wrong with my code? I used function and switch to make an arithmetic calculator. I wanted to use functions to their maximum that's why I used void func...
[1 reply] : The functions that you define at the top take two integer parameters; ... (by lastchance)
How do you to print out two arrays and their index number?
 
Hi I have to print out two arrays called "tumor" and "liver" ordered by their indexes. How exactly do I do that? It is supposed to look like this: Printing 2...
[1 reply] : Assuming integer arrays tumor and liver of SIZE = 6: for ( int i... (by lastchance)
Need Help with a bolt circle program
 
Hi, I am new to these forums and fairly new to c++ Pragrammning but I have written a couple of programs. I am just having trouble figuring out where to even sta...
[1 reply] : http://www.cplusplus.com/doc/tutorial/control/ (by helios)
Stroustrup PPP: 5.5.1 The caller deals with errors
 
Hi.. I'm reading about run-time errors in Stroustrup's PPP book, and I don't know why Visual Studio Community 2015 won't when I run the program "terminate th...
[16 replies] Last: Just to clarify, the error() function is supposed to crash your prog... (by mbozzi)
Date/Time calculator assignment
 
I have an assignment at school, where we are to "fill inn" the empty gaps in this date/time calculator. I have to fill in the "commands" section and the "class-...
[no replies]
I/O Loop using Fork() and Pipe()
 
Hi, everyone, I'm working on a college assignment and I'm having a bit of difficulty getting it to work properly. The assignment calls for us to write a C++ pro...
[2 replies] Last: Solved it! This put me on the right track. Thank you! I kept encounte... (by Yomaster)
PLEASE HELP 2D ARRAY
 
Hey everyone, I have this problem: I should divide a 2D array into square regions with a given parameter(d), find the maxes of each region and then their sum. ...
[3 replies] Last: Let me put it differently: int vstride = rows / d; int hstride = cols... (by keskiverto)
Little help with my program
 
This is my first program. It work fine, but I need someone help me with "case 5" in code. My goal is when I enter more of one object (books) in the library and ...
[2 replies] Last: Thank you very match "lastchance". The problem is solved. The program ... (by Anekluana)
sorting an Array of structs
 
I saw some similar topics about this, using the sort function, and I tried myself and wasn't able to get it working. Maybe someone could let me know what I'm do...
[2 replies] Last: What you have works for C++11, so make sure your compiler is compliant... (by gunnerfunner)
2D array regions
 
Hey everyone, I have this problem: I should divide a 2D array into square regions with a given parameter(d), find the maxes of each region and then their sum. A...
[no replies]
by JM0911
Combining linear and binary searches
 
Hello, I have successfully created a linear search and a binary search that work well independent of each other. Now I need to combine them to get them both ...
[5 replies] Last: NO - you simply aren't testing binary search. Thank you, you were ri... (by lastchance)
Classes subclasses question
 
Hello! class parentclass{ }; class subclass: public parentclass{ void print(){ cout << "Hello"; } }; Can I somehow then access the subclass methods outs...
[2 replies] Last: Hmm alright:) Thanks (by Willo123)
October 2016 Pages: 123... 23
  Archived months: [sep2016] [nov2016]

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