General C++ Programming - April 2016 (Page 20)

Using Constructors to compare/calc user input
 
We have this assignment form out teacher, a which is a bit confusing towards the end. "Define a class called Money. Your class will have two member variable of ...
[no replies]
How do I extract a single digit from a 3 digit whole number?
 
This isn't a homework question, I'm just curious. If I had a program that calculated a 3 digit number, say 123, how can I get just the "1"? I'm trying to print ...
[3 replies] Last: int num = 123; int firstDigit = num/100; int lastTwoDigits = num%100;... (by dhayden)
including multiple user defined headers leads to a problem
 
Hello, I have recently "got back" to program in C++ after a long period, and i have been dealing with programming c++ which integrated with OpenCv. I have d...
[16 replies] Last: When do they start their live? When do they die? What memory area do t... (by keskiverto)
C++ code
 
Write a program that will input the number of wins and losses that a baseball team acquired during a complete season. The wins should be i...
[2 replies] Last: num 22 line delete int (by hjx1120)
Help with Functions and Data Types?
 
In this program, I had to create a talent show scoring system. The contest has five judges, each of whom awards a score between 1 and 10 for each of the perform...
[6 replies] Last: Maybe I'll have to add an if statement somewhere? For example: ... (by raiiiny)
What is the point of declaring a class variable in a class?
 
I see this sometimes and it confuses me as to why people are doing it? struct things { private: class something; //What is this doing here? int v...
[2 replies] Last: I think you are actually asking about nested classes. Let's say you h... (by doug4)
Linked List with only Tail
 
Hello, I'm trying to create circular Linked List, and I'm only allowed to use Tail pointer - no head pointer. I have tried to modify my regular circular LL ...
[5 replies] Last: Thanks for your help. Managed to get it working. void Queue::enqueu... (by rorschach14)
help with using structures
 
need help with this code
[1 reply] : We're not just going to write your homework for you. If you show us w... (by MikeyBoy)
by ketnav
Debug assertion failed (Buffer too small)
 
Hi, I wrote a code...I had to use "strcpy_s" in it...the program is compiling but I'm getting debug assertion failed...I researched a bit and found that this er...
[2 replies] Last: Why do you use plain arrays and strcpy_s in a C++ program? The C++ sta... (by keskiverto)
how to check if the vector index
 
if i have 4 vector vector<string>player_0; vector<string>player_1={"DA","DK","HJ","H2","H3","D3","D4"}; vector<string>player_2={"HQ","HJ","DQ","DJ",...
[2 replies] Last: Or even a vector of vectors: std::vector<std::vector<std::string>> p... (by MikeyBoy)
Function that returns a reference, a pointer, or a reference to a pointer?
 
I'm having issues with my functions that return both a reference and a pointer and reference pointer. On visual studio if I try displaying these or really doing...
[8 replies] Last: Pointer is a variable that stores a value, just like any variable. Th... (by rabster)
I don't understand how ampersands work in reference parameters?
 
I don't understand why my last 3 outputs are like that when I put the ampersand. Can someone make sense of it for me? #include <iostream> #include <stri...
[1 reply] : The last 3 outputs are like that due to the fact you are taking in wor... (by rabster)
Compiler Errors - Function Calls
 
I have a main.cc class and a database.cc class (which includes the header implementation, not allowed to separate into a .h file) that won't compile. I get erro...
[1 reply] : flist.push_back( Passenger(fname, lname, destination) ); (by ne555)
I need help with a simple C++ encryption transposition Cipher program please?
 
The user key (word) is entered and I want to use that to encrypt the message. The message is encrypted be reordering the key according the where the letters are...
[3 replies] Last: just google sreach ________________________ Sogold acc - http://www.d... (by sogold)
by ketnav
Object oriented Function call
 
Hi I have a small problem, I've a code for "caesar cipher" which is functioning properly in c++ (no logic problem) in a single file...I tried to implement it us...
[1 reply] : Please help needed guys...It's a bit urgent (by ketnav)
random cards
 
this is my function to generate random cards. string facevalue = { "DA","DK","DQ","DJ","D2","D3","D4","D5","D6","D7","D8","D9","D10", ...
[5 replies] Last: http://www.cplusplus.com/reference/algorithm/shuffle/ (by keskiverto)
how to reverse texts using/without using functions
 
The second part(where I don't make use of a function) works, the first part... #include <iostream> #include<stdio.h> using namespace std; void reverse(i...
[1 reply] : First, void reverse(int x,int y,char z) should be changed to void r... (by skaa)
Problem with my Array
 
Hi everbody, I wanted to know, I made a little program that pick a word from a text file than pass the word into a Suffle letters function end then sending me b...
[5 replies] Last: Thanks by the way it worked pretty well!! (by jj09786)
Function Program Help
 
I was instructed to create a program that finds the winner of a talent contest. The contest has five judges, each of whom awards a score between 1 and 10 for e...
[2 replies] Last: An array would be helpful, but sadly I am not allowed to use an array ... (by raiiiny)
by ketnav
Online compiler for object oriented c++
 
Hi, I wanted to know if there is any compiler online to test my object oriented program...For example for c++, c++ shell online compiler is available...what ...
[1 reply] : All C++ code can be in one file. "Object oriented" does not substanti... (by keskiverto)
April 2016 Pages: 1... 181920212223
  Archived months: [mar2016] [may2016]

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