General C++ Programming - April 2018 (Page 9)

non default constructor
 
im new to this kind of thing sorry im trying to set a member string to the value held to the constructor parameter is that ok or do I need to fix it? #in...
[19 replies] Last: how do I print the subclass objects and the int nintendo int sega stri... (by sonicflare9)
by mrtam
Problem with Easy Block Dropping Game!
 
Thank You
[1 reply] : Is this kinda like dr mario or, if the blocks are not stuck together, ... (by poteto)
unistd.h question
 
Hi guys so I am told that unistd.h contains the declaration of all system calls on a linux system but when reading through it, All I can see is #define macro...
[3 replies] Last: [quote=adam2016]I am told that unistd.h contains the declaration of al... (by Cubbi)
Problems with my assignment
 
Hi everyone! i am trying to create a working currency exchange calculator for my Assignment, all was going well until completion of my program ran into multipl...
[2 replies] Last: Thanks for the help mate, i'll keep this in mind for next time. :) (by DesertFox101)
ESP,EIP,EBP with c++ and asm
 
Hey guys this may be a tough question to explain as I don't fully understand what is going on but I will try my best not to butcher it too much, anyway I am ...
[2 replies] Last: thanks Jonnin great answer :) so at the end of the day,all languages ... (by adam2016)
Stack program to check parenthesis balance
 
I have to write a program that prompts for a file name and then reads the file to check for balanced curly braces, {; parentheses, (); and square brackets, . I...
[8 replies] Last: correct. They balance , but are incorrect in syntax. You can't chec... (by jonnin)
by Fadey
Rounding from float to integer issues, (int)12.7*10 equals 126 instead of 127?
 
#include <iostream> #include <string> using namespace std; #include <iostream> #include <string> using namespace std; int main() { while (1) { ...
[10 replies] Last: ...did someone remove Fadey's post? Weird. Anyway, I wouldn't necessa... (by Ganado)
by Heymid
Odd bug which doesn't seem to have a logical explanation
 
The following is my code: #include <iostream> using namespace std; class Matris { private: int* m_vec; public: Matris() { m_vec = new int ; for(...
[6 replies] Last: I've read that compilers are smart enough to realize that... How co... (by Repeater)
by typi8
Help with files
 
Hello, I am a newbie at this and I am struggling on how to start this. I had inFile my salary.txt as shown below and I know you string in department and int the...
[1 reply] : You will probably hate me for this, but this other homework topic has ... (by poteto)
Class Project Suggestions
 
I have a class project that I am doing and wanted some personal feedback as t what I can add for an everyday user or how I can improve a users input. I am still...
[1 reply] : The first thing I see is a lot of code duplication. A few functions co... (by jlb)
by Manga
trouble with github code
 
Well now I have done it again. I bit off more than I could handle. Here is the situation. I down loaded source code from github. I want to see if I can build a ...
[2 replies] Last: ok so I just need to upgrade then. I was afraid of that, but I guess I... (by Manga)
Using operator keyword in equations invoving real numbers and complex numbers (errors I get)
 
Hello everyone, I got some code I wish to compute for some Mie data. However it has some errors relating to +,-,* and/ for complex numbers with int and doubles....
[3 replies] Last: yes, <complex>. I am saying that this complex<double> result; can do ... (by jonnin)
by mickle
HELP! arduino pong game errors
 
I am making a pong game w/ arduino/genuino 101. I have fixed 2 previous errors by defining a couple of buttons and whatnot, but now it's giving me "error:unknow...
[3 replies] Last: Did you #include it BEFORE you #include'd any other headers? (This is ... (by Ganado)
Problem with comparing arrays
 
I have two arrays that are printing out correctly, but when I try to compare the 2, the matching is not adding up. Any help will be great. #include <iostrea...
[4 replies] Last: zero is a special case. int x = {0}; //this will initialize all to z... (by jonnin)
by Heymid
Creating modifiable class member variable that's directly accessible as constant from outside
 
Imagine that you have a class A. Is it possible to create a modifiable member variable x such that A.x can be accessed from outside the class without being able...
[6 replies] Last: I agree with mbozzi: just create a public const reference to a non-pri... (by dhayden)
Deleting elements in a stack(C++)
 
Hi! I wanted to delete data in a stack if the student code is the particular code. First I copied object student to temp. Then I emptied the object student M...
[4 replies] Last: First, please use code tags when posting code. See http://www.cplusplu... (by keskiverto)
C++ Lambdas - OOP violation ?
 
I have adopted to the use of lambdas in the meantime, but i would like to start a little discussion about the ever escalating use of lambdas and the motivation ...
[10 replies] Last: [quote=bieblsoft]Typical justifications to use lambdas include stateme... (by Cubbi)
vector of strings
 
how do i pass in a string as the only parameter to each object’s constructor? new to this thing #include "stdafx.h" #include <iostream> #include <fstrea...
[1 reply] : don't start a new topic, this is exactly the same problem from the las... (by poteto)
Help If u can
 
That's the code that I did but there is an extra star in sin(90) and the negative wave is made of an extra star in each row If Anyone can help, I will be grat...
[4 replies] Last: @shady1234 : Basically, your problem is a matter of interpolating 0.... (by Ganado)
Someone please help me with this assignment
 
What is required is to create a submenu called surveyMenu that is called from option number one of the main menu. The surveyMenu should have 4 options: ...
[no replies]
April 2018 Pages: 1... 7891011... 17
  Archived months: [mar2018] [may2018]

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