
please wait
by DarkParadox
for
|
Hello, I want to ask, for(int i = 0;i < many;i++) { getline(cin,other .name); } cout << other .name; In this program other .name is what I input in the... |
Jun 25, 2019 at 5:10pm
[2 replies] Last: Your second example is using a copy of your array, so any changes made... (by deleted account xyzzy)
|
by foxxthegreat
matching a string to struct value in an array of structs
|
Currently I have a working heartbeat client that will echo a key to the server. The issue i'm running into on the server side is matching the client's key to a... |
Jun 25, 2019 at 3:02pm
[3 replies] Last: The following is not allowed in standard C++: while (getline(CLIE... (by jlb)
|
DP (1,2) |
A function is defined as f(n+2) = 2*f(n+1) - f(n) + 2 , if n is even f(n+2) = 3*f(n), if n is odd f(1) = 1 ,f(2) = 1 n > 0 Help me code this function by recur... |
Jun 25, 2019 at 6:18am
[20 replies] Last: @counter strike it gives answer of 70282652 but answer is 26030209 T... (by SparkXV)
|
by hjabba89
Need help adding a Yes continue/No end program loop
|
I don't know how/what/where to add a loop to continue if you type Y or end the program if you type N to the first question in my code. #include <iostrea... |
Jun 25, 2019 at 5:02am
[2 replies] Last: #include <iostream> #include <cstdlib> #include <ctime> int main() {... (by JLBorges)
|
by hjabba89
cin ambigous error
|
getting a cin ambiguous error and else "expected a statement error" everything was working until I tried adding a if statement to close the program if the answ... |
Jun 25, 2019 at 3:56am
[2 replies] Last: That fixed it, thank you so much! (by hjabba89)
|
by lilwhooday
Calculation
|
How do I do the calculation for "width * height * length" #include <iostream> #include <fstream> #include <cmath> #include <string> #include <iomani... |
Jun 25, 2019 at 2:19am
[1 reply] : Ok, clearly this is new to you. That's not a problem. First, since yo... (by Niccolo)
|
by Abdul hadi
char array Memory deAllocation
|
Hello Guys i am bothered that my dynamic array is not de allocating memory and gives an error If i comment the lines "delete arr and delete arr1" in the code... |
Jun 25, 2019 at 12:07am
[7 replies] Last: Really leant alot Thank You (by Abdul hadi)
|
by Xanadu4ever
Philosophic reason for initializing members as apposed to initialization function??
|
OK gang, Back for more questions and I did look this up FIRST but was unable to really match a correct answer. Maybe I didn't understand it even though I sa... |
Jun 24, 2019 at 10:34pm
[4 replies] Last: @Dutch might notice something, but my quick read is "yes", you got it.... (by Niccolo)
|
by Shibitto
I created my self a decimal challenge accidentally but can you figure it out.
|
#include <iostream> #include <string> #include <math.h> #include <iomanip> using std::cout; using std::cin; using std::getline; using std::string; using s... |
Jun 24, 2019 at 9:26pm
[5 replies] Last: All I know is the code above works, so does the bottom one. The probl... (by Shibitto)
|
by mmillar
Class can't access my vector
|
Still very new to c++ and programming in general. Although I've been picking it up quickly. However, I've hit a roadblock. I created a vector to store my class ... |
Jun 24, 2019 at 9:09pm
[10 replies] Last: You get told a Bunny has died every time one is destructed. Bunny b... (by Repeater)
|
by foxxthegreat
Error assigning struct value from getline
|
Currently I have a text file that consists of multiple names and keys deliminated by ";" like so: client1:client1skey client2:client2skey client3:client3sk... |
Jun 24, 2019 at 8:29pm
[2 replies] Last: Thank you so much lastchance that solved it. Updated code for anyone e... (by foxxthegreat)
|
by Deluge
Char Data Getting Corrupted
|
I'm trying to create a type that has a char array and integer id members: class ResourceObject { public: ResourceObject(const unsigned char* data, const i... |
Jun 24, 2019 at 7:49pm
[8 replies] Last: sorry. I have a form of visual issue where front loaded variables all... (by jonnin)
|
by tinaHR
Drill from Bjarne's book
|
Hi all, i am going through Bjarne book and at the moment im doing chapter 4 drills. The program i wrote seems to be working but im wondering, is there anything ... |
Jun 24, 2019 at 7:36pm
[6 replies] Last: About bool and test I meant how come in int test = false; i can... (by tinaHR)
|
by jjordan33
Exiting a loop early
|
Hi, I'm trying to print out the first number in a loop that doesn't exist inside an array of numbers. I'm using a double nested for loop. The methods I've trie... |
Jun 24, 2019 at 4:41pm
[14 replies] Last: Input is tedious: size_t N {}; if ( !(file >> N) ) return 1; ... (by keskiverto)
|
by DarkParadox
Pointer
|
Hello, I want to ask When will we need to use pointer?? Actually what is the benefit of using pointer?? What make pointer different from the usual progra... |
Jun 24, 2019 at 4:28pm
[5 replies] Last: pointers and their power don't really make sense until you understand ... (by ICantC)
|
by DarkParadox
getline
|
Hello, When I use getline(cin,var) sometimes it is skipped. Why is it skipped?? I know there is cin.ignore(); , but it doesn't mean I must use it whenever I ... |
Jun 24, 2019 at 4:24pm
[1 reply] : If the stream is valid it is not skipped. It may be called at a point... (by lastchance)
|
by Cjigsaw
If else statement (1,2)
|
I'm struggling with a code and I'm using if/else statement. I'm extremely need to coding here so bear with me and thank for any help. When I add a formula in my... |
Jun 24, 2019 at 4:22pm
[34 replies] Last: [quote=Cjigsaw]I do hope I can pm you to pick your brain. Why would y... (by MikeyBoy)
|
by theKlaw
Dynamic programming
|
https://cses.fi/problemset/task/1746 I have thought of this question for a while now, can't really see the subproblems for DP, brute force will surely give a... |
Jun 24, 2019 at 3:32pm
[10 replies] Last: Basic shape is a rhombus. a * * * * s * ... (by dutch)
|
by jsmithplus
If setw sets "minimum field width", why does it limit input or output?
|
If I write: 120 450 340 as input, I only get 120 back. I don't get it. int main() { int x{}; cout << "Enter nr: " << endl; cin >> setw(1) >> ... |
Jun 24, 2019 at 3:13pm
[1 reply] : The setw() is irrelevant here. (For an input stream it is only relevan... (by lastchance)
|
by zephile
Merging two of c++ games into 1
|
Our prof gave us two game program one is Snake and the other is Dinosaur. he required us to merge two games in a single program just like a game library but wit... |
Jun 24, 2019 at 10:19am
[1 reply] : Sure, you rename the two main functions to be playSnake() and playDino... (by salem c)
|