Beginners - April 2018 (Page 13)

2D array initializing in C++
 
Hello guys! i am facing a small problem here i want to know how do we initialize 2d arrays as even or odd in C++ for example Declare a two dimensional array of ...
[1 reply] : Why would you want to use random ?? The numbers are fixed. Odd numbers... (by Thomas1965)
smallest difference pairs
 
how would a write recursion program in C++ when trying to get Smallest Difference pair of values between two vectors?i know how to do it with array but how woul...
[4 replies] Last: You say that " std::sort just doesn't work with std::vector ". Howeve... (by keskiverto)
Bool funtion error need return value very stumped, help!
 
I am getting an error C2131: expression did not evaluate to a constant , failure was caused by a read of a variable outside its lifetime, and see usage of 'n' ...
[8 replies] Last: Yes I understand what it means to return a value, Clearly not. You ... (by Repeater)
Detecting Empty Squares in Chess Program
 
Hi. I'm working on a text-based chess game for blind players. I'm trying to figure out how to check for empty squares. I have several different classes for the ...
[2 replies] Last: I was doing it the way my professor suggested. He suggested that my bo... (by Living4God1991)
Addition of letters might be off by a bit HELP
 
Hello, could you assist me in fixing my letters that my palindrome_addition is adding? i added some logic to look at if the word has an even number of letter ...
[no replies]
Code won't compile
 
Hello, looking for some eyes to help with getting my code to compile. #include <iostream> #include <cstdlib> #include <iomanip> using namespace std; ...
[4 replies] Last: any idea why? There’s a number of errors, so it’s hard to say wh... (by Enoizat)
Trouble with error: Segmentation fault: 11
 
When I test my code on input file, I found that when the clock time larger than 8130, my program will be crushed, don't know why, I have already doubling the ar...
[4 replies] Last: Updated: I found an error which is in the delfix function : else{ ... (by cabbdeng)
by GonlyG
First character of string input/output incorrect
 
So I have a dynamic array of "struct bill", let's call this bill b , with size=10 to begin with. This bill has strings, with hash and ID identifying the bill. W...
[1 reply] : Hello GonlyG, If your question is all I have to go by I can not figur... (by Handy Andy)
Several Functions are built wrong for Palindrome
 
Pretty new at this and i am in need of help. could you guide me on how to fix each of these functions. i am not allowed to use arrays or anything from the <algo...
[16 replies] Last: The Main issue was a two part, my Final line output was only concatana... (by sr2cute702)
Function to read from a file
 
I have a function in my library management system that is not working correctly, it is supposed to read student number and book number from library book but it ...
[2 replies] Last: Hello imkennedy94, As I started working with the code I realized that... (by Handy Andy)
by chazaT
c++ nested loops
 
Four experiments are performed, each consisting of five test results. The results for each experiment are given in the following list. Write a program using a n...
[7 replies] Last: chipp, really, it's no trouble. it is a problem. this is not a web ... (by chipp)
How to change the derived class variable using the base class object?
 
Hello! So i'm trying to make this Product purchase small little program. And the Purchase is inherit from the Product, it all runs fine for now, except ...
[2 replies] Last: I made this change and i do agree it was quite unlogical and the code ... (by FreeSocks)
word processor
 
Write a simple word processor. This processor can check for start of sentences, after a period or full stop the word should start with capital letter. If the w...
[1 reply] : Hello Rajesh23, This is a lofty goal for a beginner. Even with what I... (by Handy Andy)
struct array association?
 
Im not sure how to describe what I need, I need a structs constructor to have an int passed in and from that int have a predetermined, full, array be the on...
[1 reply] : array be the only variable for the struct Can you please clarify? - ... (by Enoizat)
Binary search help
 
This is an account validation program using a binary search array. When I enter any value it gives me the message:"Account number 12520255 is valid" That's th...
[1 reply] : Return type should be int if you're returning the position. last shoul... (by tpb)
C++ game help
 
I am trying to make each player that is entered linked to a number which is their number of lives and I'm not quite sure on how to do it, I need to make for exa...
[1 reply] : One easy way you can accomplish this is by using classes. something ... (by Uk Marine)
by Pkmost
I made a basic calculator, see how it is and talk your opinion please :)
 
See my code and talk your opinion about how like it. I'm new, and i have made some codes to pratice, like this calculator. #include "stdafx.h" #include ...
[2 replies] Last: Hello Andy, Thank you so very much, i appreciate your tips and unders... (by Pkmost)
Using a cin in a do while loop
 
How do I add in cin to every cout that I do in my do while loop I want to make it so that whatever number of players I put it will ask "enter player " a "'s na...
[1 reply] : std::string names ; do{ std::cin >> names[a-1]; //index goes from ... (by ne555)
how do i publically inherit the subclass from the base class
 
#include "stdafx.h" #include <iostream> #include <fstream> using namespace std; template <class game> class game { private: protected:...
[8 replies] Last: thanks peter87 (by sonicflare9)
Passing data to a class and storing it in a struct array
 
Hello. I have been working on this code for weeks and somehow i still can't understand how to operate a class. So what i am trying to do is get data on books st...
[10 replies] Last: oh okay thanks so much i believe i am getting it now (by CrixStixs)
April 2018 Pages: 1... 1112131415... 25
  Archived months: [mar2018] [may2018]

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