General C++ Programming - July 2017

I need help with my Dice program
 
My professor has assigned a program that rolls two Dice. I am pretty much done coding it I just can ...
[2 replies] Last: And if you just want to stick to what you had and work with that then ... (by closed account 48T7M4Gy)
by pozoJ
Im unable to find the syntax errors
 
struct TwoVals { int x; double y; }; int main() { TwoVals.x = 10; TwoVals.y = 20; ...
[1 reply] : TwoVals vals; // declare variable vals of type TwoVals vals.x = 10; ... (by closed account 48T7M4Gy)
by nsi
A Very Strange Phenomenon
 
Dear C++ programmers! I am experiencing a very strange phenomenon. I am coding up a CFD code solv...
[2 replies] Last: they are completely the same No they aren't. 5.0 / 9.0*rhov_1*gd_1... (by dhayden)
by mmgh
std::find_if on slave nodes
 
Hello, I am broadcasting a vector of object whose members are all std::string from the master nod...
[1 reply] : It's impossible to tell what the bug is without seeing the code. Pleas... (by dhayden)
by ztdep
why the C++ Mathematical Expression Library compiled so slow
 
Dear friends: I downloaded the C++ Mathematical Expression Library from the web, and i uploaded it...
[2 replies] Last: Since it is only 1 header file using pre-compiled header files would b... (by Thomas1965)
Virtual Functions Question
 
Hello, I have a question regarding virtual functions. class Base { public: virtual void sou...
[7 replies] Last: You only use polymorphism with Object Oriented Programming, never with... (by kbw)
by nyck66
C: seg fault when filling array inside struct
 
I have: typedef struct { int* data; unsigned int len; } intarr_t; I do: intarr_t* ia=mal...
[2 replies] Last: As stated, need to assign a value to ia->data. intarr_t* ia = ma... (by Chervil)
by nyck66
C: Asteroids shot and asteroid collision detection
 
I realize my code is C but the section I have questions about is the same as C++ (I think). I am h...
[5 replies] Last: @lastchance thanks, it worked when I only modified shot and not roid. ... (by nyck66)
reference can't be bind to different object
 
As far as I know, reference can't be bind to different object But, why the reference c in code belo...
[3 replies] Last: You don’t need to blindly trust me, of course :-) If you read here ... (by Enoizat)
Understanding an exercise
 
Hi, I'm trying to solve the exercise of chapter 20 of the book: Programming Principles And Practic...
[1 reply] : > Does it mean that we should define some characters as separators for... (by JLBorges)
StringStream >> char not working?
 
We recently covered function pointers and I had an epiphany - that an array of them can be used as a...
[3 replies] Last: Something like this perhaps: char next ; while( ss >> next ) { // ext... (by JLBorges)
Erase one element in vector in 'for' cycle
 
Below are some code which use erase in 'for' cycle. It want to remove a element which meet the c...
[3 replies] Last: > I think it is OK? Yes. This would be the idiomatic way of doing t... (by JLBorges)
Array - for storing the first value
 
I have written a C++ code for my project. I am having trouble storing values in arrays. I have writt...
[3 replies] Last: It sounds like you need to share data between methods of the Motion cl... (by dhayden)
accessing members of class
 
Hi - I'm writing some code for a filter for a DSP application. The user needs to access the membe...
[1 reply] : declare it as protected, the the derivative class can use it. (by ztdep)
Program to correct unwanted space and capitalization; but I don't want it to delete the first word
 
// Trying to run on Visual Studio // EXAMPLE: THIS is a space TODAY. // SHOULD BE: This is a spac...
[no replies]
Unordered map and files
 
I need to let user fill unordered map, write this map in file and then read and use this info from f...
[1 reply] : Here is a way you could break the problem down into manageable pieces.... (by dhayden)
Need Help in circuit diagram of 8*8 reed switch matrix
 
I am designing 8*8 reed switch matrix which will be connected to Arduino. I am using Arduino Duemila...
[1 reply] : You can use the internal pullups of the arduino if you're willing to a... (by Jerrydgevdev)
PPP2 Chapter 15 Exercise 6 (1,2)
 
Exercise specification: Design and implement a bar graph class. Its basic data is a vector<doubl...
[29 replies] Last: How do I get the bars to appear inside the 600x400 area of the window,... (by DragonOsman)
by Handge
How to make game save code
 
Hey, I was just wondering how would you make a game save code. Something like a long set of numbers ...
[12 replies] Last: Well thanks all! Thanks, Handge (by Handge)
Question about notation
 
I know what %c is if c is a character, but can someone explain me what c%7 == 0 means? Thanks...
[6 replies] Last: Thank you very much guys! (by aurimas13)
July 2017 Pages: 123... 6
  Archived months: [jun2017] [aug2017]

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