General C++ Programming - October 2017 (Page 7)

Trial by trial update of response threshold
 
Hi, I'm programming a Stroop task in which the response treshold is supposed to be adjusted after every trial according to participants' performance. I work wi...
[no replies]
making only 3 attempts to guess the value
 
#include<iostream> #include<iomanip> #include<conio.h> using namespace std; int main() { string user,key,name,selection,item; int atmp,guess,pa...
[1 reply] : JSYK, your question hasn’t received much attention because your code... (by Duthomhas)
Quadratic calculation using void
 
After the user inputs an A, B and c value it gives me an x and y value. This is the quadratic formular −𝑏±√𝑏2 −4𝑎𝑐 2𝑎. The questions requ...
[3 replies] Last: OP has made a pretty specific claim about the function returning void.... (by Duthomhas)
boolean expression getting "expected primary expression error"
 
With this area of my code, I'm getting "expected primary expression before 'm' on line 20 if (boolean n=true && boolean m=true) the full area of code is: ...
[1 reply] : = is assignment == is comparison comparing a boolean against true or f... (by ne555)
HELP: Convergent Series
 
For an assignment I have to approximate the value of the series below by calculating the partial sum of the convergent series to a user inputted number of terms...
[no replies]
Switch , enter more values.
 
In switch how can i enter more than 1 value ? I mean i have a switch that has multiple cases and i want to execute 2 of them ..
[4 replies] Last: if it is very complex you may need to pre-switch boil the cases down t... (by jonnin)
Showing precision incorrectly
 
The following program should show the current precision. Instead it always shows 6: #include <iostream> /// cout #include <iomanip> /// setp...
[3 replies] Last: Side note: I think this is the perfect case study of why abusing opera... (by Duthomhas)
Inheritance doesn't call overridden function, calls base version instead
 
So I'm here again with another question. I've almost finished the basis of my game engine, but when I want to test what I've made, it only renders a black scree...
[5 replies] Last: Now I get the following problem: //GameState.h #ifndef GAMESTATE_H #... (by goldenchicken)
Help
 
If you follow too close behind another car and that other car stops suddenly, you will not be able to stop in time, and you will crash into the rear of that o...
[1 reply] : What's your question? PLEASE ALWAYS USE CODE TAGS (the <> formatting ... (by AbstractionAnon)
C++ and C
 
Hi all, I've heard about both before but recently I was surprised by the opinions of Linus Trovalds. There are many threads on comparing the two and I read so...
[16 replies] Last: > It doesn't need to be part of the type system That is the raison d'... (by JLBorges)
by SasuKe
Binary Search
 
I have to create a search function for a binary tree. The tree is given below: 5 4 8 11 13 4 7 2 1 These are the specific instructions: 1. A function to searc...
[1 reply] : Don't double post. http://www.cplusplus.com/forum/beginner/223322/ (by Hippogriff)
Draw a right triangle on a 25x25 grid using two user-defined coordinates
 
Hello everyone, I have a homework assignment that requires the user to enter 4 numbers that make up two coordinates (x1, y1) and (x2, y2). The assumption is tha...
[2 replies] Last: The part I'm having trouble with is knowing how to use my coordinate v... (by CopaceticCoffee)
Is it advised to not to separate declaration and definition templated class functions.
 
Hi everyone :) I have a query regarding use of templates for class member functions. Usually we separate the member function declarations and definition in ...
[3 replies] Last: @keskiverto Great explanation! (by mbozzi)
by zesan
What to look at if compilation time expires ?
 
My code works but in the end no solving result appears, is there any error in the code ? #include <bits/stdc++.h> #include <iostream> #include <string> #incl...
[6 replies] Last: The problem is that for each node you pop off the queue you are creati... (by lastchance)
Application crash in function
 
void foo(vector<Data> &matrix) { double parameter{6}; vector<Data> a; something(a, parameter); //Function created earlier. Crashes with this line ...
[2 replies] Last: Impossible to tell without seeing the code of something(). Would be ni... (by AbstractionAnon)
__LINE__
 
Hey guys, I'm trying to understand a code here and this "__LINE__" appeared into a cout. What does that does? thanks!
[2 replies] Last: Thanks!! (by Lucas Fiorini)
Using parallel arrays with void functions
 
Good day I do not enjoy asking for help in this way but i am really stuck. This question is in an old exam paper i am going through and i have no idea how to g...
[1 reply] : looks like you just need find the max of subscriptions and return that... (by jonnin)
Compiling
 
Guys i have this code that is handling structures, but is giving some weird outputs Can anyone have a look and tell me whats wrong #include <iostream> ...
[3 replies] Last: You have an additional problem: Lines 20-27: You initialize only th... (by AbstractionAnon)
PPP2 Chapter 18 Exercise 8 (is_palindrome() function number 3)
 
This is for the exercise in Chapter 18 where he asks us to modify the is_palindrome() functions from Section 18.7 to take the approach of generating a reverse c...
[19 replies] Last: Man, that's the simplest possible solution. Thanks for that. I can't... (by DragonOsman)
Need help debugging this (beginnerish)
 
Hello, i'm a student currently and I'm stuck with my project because for some reason my container gets values in it that shouldn't exist. There's no place in m...
[3 replies] Last: Your container is an array of objects. Every element in the array cont... (by Repeater)
October 2017 Pages: 1... 56789... 16
  Archived months: [sep2017] [nov2017]

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