General C++ Programming - May 2018

by Bleron
I need help solving this!
 
Write a full program that will read from the user 24 full numbers that represent the income of a firm for each month for a 24 month period. Then counts and disp...
[10 replies] Last: I tested it it's working perfect. Thank you one more time. I also have... (by Bleron)
Erasing elements from the vector container
 
Hi all. I know how to erase / remove elements from the vector, but don't really know what's going on; std::vector<Entity*> entities; //adding : void addEnti...
[1 reply] : When you erase an element all iterators to that element (and to all el... (by Peter87)
Visual Studio 2017 Programs Slower Than Code::Blocks'
 
The programs I make in MSVC are very slow compared to that of Code::Blocks', why is that? The programs made in Code::Blocks are a lot faster, is this a compiler...
[8 replies] Last: Glad to help :) (by Ganado)
Efficient/Elegant way to select random entry from Vector Matching Criteria?
 
Hi, Given a vector std::vector<std::pair<std::string, Gender>> myVector = { {"Aaron", Male}, {"Anna", Female}, {"Bryce", Male}, {"Lynn", Female}, {"Abbie", Fe...
[1 reply] : well, maybe :) if the distribution of names is nearly 50%, checking a... (by jonnin)
by kafka
BigInt problem
 
Hello guys. This is the problem I have to solve for class until next week: Given: n Info about n: natural number with at least 20 digits and maximum 1000 ...
[18 replies] Last: This do you @kafka? #include <iostream> #include <vector> #include <... (by lastchance)
need help
 
Hi everyone, if anyone is able to help greatly appreciated I am currently up to stage 4 and am hopeless with the loops, so if anyone can help from stage 4 onw...
[2 replies] Last: If you've completed step 3, then you have a program that runs one game... (by kbw)
Understanding Pointers and References
 
I have been doing C++ for quite a while and still cant seem to get a grasp of how pointers and references, using and when to use them. Below is a basic polymo...
[10 replies] Last: Yet more fun with parentheses: int * fun ( double ); // function int... (by keskiverto)
c++ socket connection "Connection refused"
 
I'm writing a server/client application. my server works great on local ip addresses and i am able to test all of its features using 127.0.0.1 as ip address and...
[2 replies] Last: I agree, this is a routing issue my Iranian friend. Loop-back works be... (by Computergeek01)
Reading a file and storing the data into 2D array
 
Im trying to get my code to read in a file with 10 lines and 10 characters on each line and then store each character read in into a 10X10 2D character array. T...
[8 replies] Last: I agree that we need to see the code that you tried that did not work.... (by doug4)
Why is it colliding
 
i made a program and i cant find root of problem. Code is #include<iostream> #include <cstdlib> #include<conio.h> using namespace std; int main(){ int...
[1 reply] : I think what's happen is that when you take the diamond the bomb happe... (by Peter87)
Error: variable has incomplete type void
 
Hello I'm fresh into c++ and I'm really struggling with this error. I'm tasked to have all the outputs for my values of area, perimeter, and diagonal in a disp...
[3 replies] Last: Yes. Just invoke it, like we invoke the other functions that return va... (by JLBorges)
how do i even do this
 
Stage 1 To begin, display the jackpot to the screen and prompt for and read the player’s choice. Display the player’s choice to the screen as seen bel...
[2 replies] Last: the whole question will be posted tonight then along with the sample o... (by baijy019)
by doug4
Warning on Deprecated Functionality
 
Here's the question. Is there any way to add a compiler warning to code such that it is only activated when a function is called? I have created a code gene...
[5 replies] Last: Thank-you @Peter87. That looks like what I want. (by doug4)
BUILDING PROGRAM
 
given sequence 1 2 4 8 16 23 ... so An+1=An+suM of An; and how to write program wich calculate An element. i wrote but it need Much time.
[11 replies] Last: You STILL haven't defined your actual sequence in an intelligible mann... (by lastchance)
Erase integer
 
Given numbers 1 to N and A number beetwen 1 to N. You have to erase odd or even index number to reach A. If you erase edds write 1 , else 0. 1 2 3 4 5 6 7 ...
[4 replies] Last: Thanks (by andriasss)
I need help with this game of mine please urgent!!!
 
Ok so I'm new to here but I'm trying to make a game for my project at school the game is going really well but I can't get the input(cin) right when I ask the u...
[7 replies] Last: Any use of cin is subject to errors that need to be handled to prevent... (by Proidentini)
Reading file into 2D array
 
can someone help me read a text file and store the file contents into a 2D array? When I run the program it keeps giving my random numbers. The numbers will b...
[1 reply] : cout << array; This makes no sense. (by Repeater)
Help with understanding problem(s)
 
Hello everyone, this is my first time using this forum. I really need help with my homework. I currently can't compile my work. I had to download a 4gb extra...
[3 replies] Last: It's mostly correct, just a couple of errors. 1. In expand(), you don... (by kbw)
Reading file into 2D array
 
can someone help me read a text file and store the file contents into a 2D array? When I run the program it keeps giving my random numbers. The numbers will b...
[2 replies] Last: How would I go about printing the array with another double loop? Shou... (by closed account EwUS1hU5)
Missing factor?
 
Write a function that accepts an int array and the array’s size as arguments. The function should create a new array that is twice the size of the argument a...
[1 reply] : Remove the semicolon at the end of this line: int * expand (int numb... (by tpb)
May 2018 Pages: 123... 11
  Archived months: [apr2018] [jun2018]

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