General C++ Programming - January 2019 (Page 6)

game. pay
 
help
[4 replies] Last: New thread -> http://www.cplusplus.com/forum/general/248558/ (by salem c)
creating dynamic array that sums prime numbers
 
Hello guys, I am having challenges with how I am suppose to go about coding the following problem: An array is defined to be a Magic array if the sum of the p...
[4 replies] Last: Any solution will iterate through each element in the array, check for... (by Browni3141)
Having issues with Mindtap coding
 
This is my code which I wrote for the following assignment. Cindy uses the services of a brokerage firm to buy and sell stocks. The firm charges 1.5% service ch...
[2 replies] Last: Instructions Write a program that allows Cindy to input: The purcha... (by dhayden)
Am I better off learning with GCC rather than VC++? (1,2)
 
I tried Geany and CodeBlocks and found it took too long to debug with those, and went with VS C++, and was much more productive right off the bat. However, I...
[22 replies] Last: @Cubbi, Code::Blocks as one of the bundles, the MinGW bundle, includes... (by closed account E0p9LyTq)
by slei
dynamic_cast and expections disabled
 
Hey, I've rarely used dynamic_cast and mostly avoid if possible there for I have actually no idea what happens with it when expections are disabled (and/or rtt...
[11 replies] Last: @OP, You keep asserting that dynamic_cast should work like static_cas... (by doug4)
Card Game Printing Incorrect
 
I'm trying to display King, Jack, Queen, Ace for cards that have a score of 10 or 11, because otherwise the player won't know what there card is as 10 = a king,...
[5 replies] Last: I only posted the code that would need to be seen in order to fix the... (by dhayden)
i want to compare two file and find the same strings
 
hello guys, I just want to compare two files. Then i want to display the same strings on the screen. I have strings in these files. Each strings are on the dif...
[3 replies] Last: At line 43 you're using myArray1's index to insert into myArray3. So i... (by dhayden)
Deriving classes from smart pointers ?
 
My question is about deriving classes from smart pointers. I haven't come across examples of code doing that even though it seems to me like a nifty solution i...
[8 replies] Last: [quote=CABrouwers] However, it requires to give up the delayed calcula... (by TheIdeasMan)
I need explanation on the code snippet
 
I succeeded in converting a C# sharp function to C++ and the code executed successfully. I however can't seem to understand and explain the block of code below ...
[7 replies] Last: You're allocating memory to check if an integer has any odd decimal di... (by helios)
insert() function of containers
 
The book Essential C++ says: iterator insert(iterator position) inserts an element before position. The element is initialized to the default value of its...
[5 replies] Last: @JLBorges I got it. So I can use emplace() to play this role. (by locatee)
Compiled files in Visual Studio print desired result, but return errors in Unix terminal
 
I have linked my two files together and compiled them in a Unix terminal and this is the error message the compiler returns for line 31, 46, and 64: "'sizeof' ...
[8 replies] Last: Yes. Good Luck !! (by TheIdeasMan)
clang++ compiler not finding header file <mysqlx/xdevapi.h>
 
I am compiling a dylib with the following command: clang++ -I/usr/local/mysql-connector-c++-8.0.13-dynamiclib/include -L/usr/local/mysql-connector-c++-8.0.13...
[8 replies] Last: Should I drop the lib initials when I am linking to a library using f... (by TheIdeasMan)
std::default_randome_engine().seed(seed);
 
Hi. I am currently developing a 3d game. I was generating random terrain and everything works perfectly. I am using the default_random_engine class for Perlin N...
[3 replies] Last: @helios, in the method Perlin Noise, this is necessary. And by the way... (by hassanAman)
Canot access type from derived templated class
 
Hey guys, i got the following code: template<size_t user_data_length> class CParent { struct SFoo { int foo_1; array<uint8_t, user_data_length> data; ...
[6 replies] Last: hey thx for your helpfull answers. I did some reading during the last ... (by JuliusCaesar)
by c345
How to make the program ask me something more than once
 
We were asked to build a program where the computer receives the amount of integers and then we get asked each time to enter a number depending on the amount I ...
[1 reply] : How to ask the user for something 'x' times? A for-loop is how. for ... (by Grime)
whats the difference between &array and &array[0]?
 
Hi guys I should know this and probably did at one stage but just wondering what is the difference between &array and &array , so the first one is the addre...
[3 replies] Last: thanks guys that makes sense When you do in.read((char*)(&number),... (by adam2016)
by ota2
to make a qsort() like function with quicksort example, sorting not ordered
 
Hi. i have trying to make qsort() like function from quicksort codes in http://www.algolist.net/Algorithms/Sorting/Quicksort . From code of that site it works. ...
[3 replies] Last: > It should be void *array, because of function should run also on str... (by salem c)
by Trib
why does the value of d do not change?
 
#include <iostream> using namespace std; int main() { int a,b, c, p, x, x1, d; int nr=0; cin>>a>>b>>c>>x; x=x1; while (x1>0) { p =...
[14 replies] Last: after meditating a bit yesterday i found the mistakes by myself, thank... (by Trib)
Solutions to Quadratic Formula
 
So, I need help for my plate 2 in school, I think my code was wrong because it didnt give the correct answer for factoring and maybe in completing the square to...
[3 replies] Last: Why is dev-c++ so popular??? kimmaylovesyou did you have to use dev-c... (by Grime)
how to do you chain arrow operators together?
 
like the following foo1->foo2->foo3->foo4();
[6 replies] Last: worked like a charm! :) (by programmy)
January 2019 Pages: 1... 4567
  Archived months: [dec2018] [feb2019]

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