General C++ Programming - October 2016 (Page 10)

Help with C program
 
5.17 (Multiples) Write a function isMultiple that determines for a pair of integers whether the second integer is a multiple of the first. The function should t...
[1 reply] : The function should take two integer arguments and return 1 (true ) i... (by keskiverto)
parallelizing random number generator suggestions?
 
I am trying to randomize this random_number generator, however , as i am new to c++ I am struggling to do so. any suggestions as to what steps i should take ? ...
[3 replies] Last: This code uses OMP to generate random numbers in parallel. #include "... (by Moschops)
char arrays and memory allocation
 
My question is focused on the memory allocation of char arrays. I know that with strings, the size of the string is dynamically allocated in the background via...
[3 replies] Last: In C++, everything with a complete type has a fixed size. No Even ... (by cire)
Need help understanding my errors
 
/* Write a program that will determine the user’s weight in other locations in our solar system. The program should : Ask the user to enter the weight(on...
[1 reply] : cout << "What is your weight (in pounds)? /n " << endl; "\n" fo... (by integralfx)
by Bored
How can I define '±' to use as a operator?
 
I'm a noob, who is trying to create a simple calculator to practice the whats in the "Basics of C++", but I'm finding it hard to create an operator for ± so I ...
[2 replies] Last: The standard defines a list of operators that can be overloaded + - *... (by gunnerfunner)
Size of memory allocation for pointers
 
I am slowly starting to really get a grasp on pointers, but I am quite confused on how the memory allocation of pointers is beneficial: - On most compilers,...
[4 replies] Last: I've never thought of it this way, it makes total sense now. Thanks! (by dhaneku b)
Looping back to the original menu after using a switch in a submenu.
 
I have a project for school dealing with taxi orders along with miles used for varying taxi services with varying rates. My question or I guess what I would lik...
[no replies]
by musehm
Need help with data storage in array form
 
Hi, the problem I am having right now is how to start the algorithm for setting up arrays in Notepad to be referenced in Dev C++. My program should start wit...
[3 replies] Last: Should I use library array for this? (by musehm)
How Stuff Works - C - Sorting a Struct Array
 
I have to sort an array of structs called "records" in one integer field (does this just mean I have to sort the array based in order?). Here are the specs for...
[4 replies] Last: It's jut three lines of code. I did it myself within the same functio... (by DragonOsman)
function not doing the math
 
so i need to create a function that turns time into minutes and find the minute difference. here is the code that i have it only finds the difference between th...
[2 replies] Last: Make sure you're using code tags by the way, #include <iostream> #... (by muffsez)
Friend Operator< : How to Write?
 
Hello, I've written a class that overloads the relational operator <. I would like to make this into a friend function instead, how do i do this? class Con...
[2 replies] Last: Thank you, that really helps put it into context. (by Carter205)
Is MinGW Still Current?
 
Hey guys, I ditched MSVC because I just don't have space for it (128GB SSD can't support the ridiculous amounts of storage for VS) and decided to try out a "...
[2 replies] Last: Oh you are a lifesaver! I couldn't find a current version, and when I ... (by Yawzheek)
I'm really lost this time
 
I am extremely lost with this programming assignment. Can anyone guide me? I am using Xcode. Section 1 : Show a menu and receive a selection from a user. ...
[no replies]
Using find
 
so I am supposed to be using find in order to check if the value of a given number is in my array here is what I have int a = {1, 2, 3, 4, 5}; int* fi...
[2 replies] Last: You're a life saver! I tried following the template like you said but ... (by Univcplus)
C++ arithmetic calcs
 
I am running a simple arithmetic operation in a charting software sierra chart: Eg float x = 1.2f; float y = 1.0f; //this variable is set as "float" type by th...
[2 replies] Last: float I am now fearful that 2-1=1 only sometimes in this game. How tr... (by Amateuer1000)
I need help understanding this
 
I need help understanding why this wont print out the months. I am getting the month numbers but not the strings. #include <iostream> #include "Month.h" ...
[2 replies] Last: In addition to what booradley60 said, have a look at your constructor ... (by MikeyBoy)
by bozmin
list with overloading operator and a constructor
 
hey, if I have to call a file.txt to open it and pick up all it's content, should I use a constructor for the name of the file? I tried this for the construct...
[2 replies] Last: hi, Thank you for the answer. I will try to make the first one working... (by bozmin)
Memory leaks and pointers
 
Hello guys, Regarding to an exercise I wrote the code below. The program runs well but I have two questions about it: 1- Is there any memory leak in the progr...
[3 replies] Last: Do you mean if we create a pointer using new, it remains even out of ... (by MikeyBoy)
Templates and Inheritance
 
Hello, I was just wondering how I can get my classes to work using inheritance and templates, but I have this error: classes.cpp: type/value mismatch at arg...
[4 replies] Last: [quote=TheAussieGermanBoy]So how would I type up that? What do I need ... (by coder777)
by LuisGt
stack / broken code
 
i have problems with this code i was following an example and i does run on xcode but it does not run in other editors as jgrass #include <iostream> #i...
[4 replies] Last: What compiler are you using when you received the error? How exactly d... (by jlb)
October 2016 Pages: 1... 89101112... 23
  Archived months: [sep2016] [nov2016]

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