Beginners - October 2016 (Page 3)

PLEASE HELP 2D ARRAY
 
Hey everyone, I have this problem: I should divide a 2D array into square regions with a given parameter(d), find the maxes of each region and then their sum. ...
[no replies]
cwchar trouble
 
Let's just move on the subject. My codeblocks version is 16.01, my win is 8.1 with 64-bit operating system. I've just installed the current version of codeblock...
[no replies]
by Alex A
issues using ofstream (Output stream class)
 
Good morning guys, I'm having issues using ofstream (Output stream class). I have a text file in my thumb drive called infile and I'm using ifstream to copy 7 ...
[6 replies] Last: Is there a way to use one variable instead of seven numbers ? Some... (by cire)
input help
 
How can i have the user input a 24hr time and have seconds optional. for example they can enter 20:40 with int x,y; char s; cin>>hour>>s>>minute ...
[1 reply] : You can give them a menu - search for switch-case and you should get y... (by gunnerfunner)
no appropriate default constructor available
 
I get this compiler error: error C2512: 'Graph_lib::Ellipse': no appropriate default constructor available I'm trying to create a class Arc that inherits from E...
[1 reply] : Can you show us how Graph_lib::Ellipse uses Ellipse objects? Is it in ... (by gunnerfunner)
When to #include .h vs .cpp
 
I am having trouble understanding why some of my programs do not work. From what I understand, .h files are for declarations, and the .cpp files are for impleme...
[no replies]
by kmce
creating references
 
I am working off a piece of code that i am having problems understanding // Inventory Displayer // Demonstrates constant references #include <iostream...
[2 replies] Last: Sorry, just new to c++ so still slightly confused. The book says all r... (by kmce)
by nbro
Generate always same sequence of random numbers
 
Hi! I'm using the uniform_int_distribution and uniform_real_distribution along with the std::mt19937 engine seeded with random_device . If I wante...
[3 replies] Last: > if I use the same seed, am I assured that I will always have the sa... (by JLBorges)
Addition Calculator (tweaked)
 
I wrote some code for an addition calculator. It adds more than 2 numbers at a time. The way to input the numbers is: num1+num2+num3... Example output: ...
[4 replies] Last: For example (and you can simplify this by removing eraseChar() if you ... (by lastchance)
compare magnitude of two vectors
 
How do I correct to compare the values of the vectors ??? The length I figured, I can not compare)) class Vector { float x, y, z; public: Vector(); ...
[no replies]
by nbro
Move semantics in C++
 
Hi! I've tried to understand move semantics in C++, but I'm not sure about it and when an object is moved and what it means to be moved. Suppose I have a func...
[no replies]
by louwin
How do I write a COLORREF colour to a BMP file?
 
A real NEWBIE question.... I have been colouring a Mandelbrot (and writing to a BMP file) with the following routine.... double t = (double)i / (doubl...
[3 replies] Last: On further research I found A solution. It is not the one I hoped for,... (by louwin)
by CTLZ
Segmentation fault
 
The great people of this forum please help i'm at my wits end trying to find why i got segmentation fault. It only errors when i print record with coordinates (...
[5 replies] Last: ¿the hell are you talking about? the only print() function present on... (by ne555)
Function template help
 
Hello... I need help for writing a template version of the iterative binary search algorithm that searches an array of arbitrary type for a given key? I don't k...
[no replies]
by Dkob1
Binary Trees
 
Are the ones in bold right? Given a search key k and a node v of a binary search tree T, drag and drop the proper action to each condition occurring in the fin...
[4 replies] Last: ok thanks. (by Dkob1)
operator overloading - operator+
 
I've created a time class, which I would like to add the operator+ to. I'm getting an error though: $ make g++ -c -Wall -std=gnu++11 time.cpp In file inc...
[1 reply] : Search for C++ Primer (5th ed.) by Stephen Prata - Chapter 11 - Time o... (by gunnerfunner)
I can't figure out pointers
 
I would like to create a sub routine for creating strings to full caps so I can create a menu feature that would be able to distinguish spelled words regardless...
[2 replies] Last: OP: there was an interesting discussion on another board recently abou... (by gunnerfunner)
C++ creating and printing an STL list (instead of a linked list)
 
So right now I'm trying to implement a list using STL but I'm stuck at what to do for the print function (so I'm not sure how to test if the insertFront functio...
[3 replies] Last: OP: forwardPrint() should also be declared const (by gunnerfunner)
by kmce
Beginner-function print out
 
I am just starting c++ and having a slight issue understanding a piece of code. #include<iostream> using namespace std; void Add25(int &b) { b = b...
[2 replies] Last: Yes that is right. He doesn't really understand the "&" part I'm gla... (by cire)
by TeeWee
Arrays help with loops
 
I understand arrays is a data storage of # the problem im having is using it with loops and if, else say user input 10 numbers that are negtive or posive nu...
[2 replies] Last: Thank you so much for your time to write all that info out. im current... (by TeeWee)
October 2016 Pages: 12345... 51
  Archived months: [sep2016] [nov2016]

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