General C++ Programming - April 2016 (Page 13)

by mkb555
Heap grandparent
 
I'm about to code a min-max heap using a vector, and in order to do so I need to be able to access an element's parent and grandparent. I know that the formula ...
[no replies]
by a10e29
Down cast and try catch
 
Hey Guys, Two questions in one. First I'm down casting, from what I've read it will slice off not know about the other stuff, move everything possible up the ...
[3 replies] Last: Who does throw? Good point. Even better example Why do you want t... (by a10e29)
Need help on text file reading
 
Hello everyone, I am working on a school assignment requiring us to process student records. However while choosing to list all the records from my menu, the li...
[4 replies] Last: Is using the C-strings a requirement? Because C-strings are a fixed ... (by jlb)
Exception Boost::asio
 
Hello guys i have this code in vc++ // Boost.cpp : definisce il punto di ingresso dell'applicazione console. // #include "stdafx.h" #include <iostream> #incl...
[no replies]
by pabs8
Create a new namespace in VS for a C++ project
 
Does anyone know how to create a NEW namespace in Visual Studio 2015? Not change the default one's name, but to create an entirely new one in addition. It is s...
[3 replies] Last: When you create a C++ project, only the global namespace exists: i.e. ... (by Little Captain)
can someone please tell me how functions work??
 
i am teaching myself c++ and i thought that when i pass an argument to a function it supposed to use it. but his one says "salary was not declared in this scope...
[2 replies] Last: At this web site there is a great tutorial. http://www.cplusplus.com/... (by doug4)
What is boost?
 
I've heard about this library but why everyone loves it?? Do you have any tutorial ?
[2 replies] Last: At least some of Boost content has become "advanced, tried and true" t... (by keskiverto)
Explanation for a simple maze algorithm?
 
I want to know the steps involved in generating a 2d maze of a specific width and height, in detail.
[1 reply] : i just happen to have the source code of something you may be interest... (by g3n0m3)
Name Scrambler and Selecter
 
I am doing a side project for a class, and what I want to do is read a random name using getline() , then put that name into a new text file, then choose a ran...
[4 replies] Last: Ah, forgot about that. It works perfectly, now that I've added the f... (by Tiidriioblaan)
by dr86
Introducing global object into a library
 
Hello. If I have header file basicKinematicCloud.H containing #ifndef basicKinematicCloud_H #define basicKinematicCloud_H #include "Cloud.H" #include...
[8 replies] Last: Yes, I completely forgot that I have #include "createFields.H" insid... (by dr86)
by Kdeezy
adding 2 large numbers using arrays c++
 
Here is my task: Write a program that inputs two positive integers of, at most, 20 digits and outputs the sum of the numbers. If the sum of the numbers has more...
[5 replies] Last: how is not reversing? could you explain... Well, the loop steps thr... (by Chervil)
Object oriented c++, make a class that does the basic operations (+,*,/,-)
 
So i know a little bit of basic c++, but i am new to object oriented programming. My task is to make a class that does calculations with +,-,*,/ i need to modif...
[4 replies] Last: We're not going to do your homework for you. You wouldn't learn that ... (by AbstractionAnon)
Easy way to dump attributes of a class
 
Hi, I'm looking for a method to dump all attributes of a class with one function. Example: class A { int a,b,c; } class B { int d,e,f,g; } I have to...
[7 replies] Last: In Delphi you have RTTI to access the meta data of an object, I think ... (by Thomas1965)
Undefined Reference in virtual functions and inheritance classes
 
I am having difficulties with compiling the these two programs together. I get no errors when compiling the function file and the main into .o object files but ...
[3 replies] Last: > Isn't TwoDimensionalShape(); the default constructor? If you don't d... (by ne555)
MYSQL executing multiple statements
 
Hi, I have the following code, which needs to execute three sql statements. The first two work and return results, but the last INSERT doesn't, any idea why? ...
[1 reply] : What is the return value from the last mysql_query ? (by Thomas1965)
problem with if condition
 
this is my code, i am having trouble with my if conditions at the end to make sure that if sum of n1 and n2 is greater than 20 digits it says its invalid. the w...
[3 replies] Last: thanks for answering, and this is my first time using a forum so i di... (by a10e29)
Recursive Sum of Series
 
I'm trying to write a recursive function that calculates the sum of the first n terms in the series: 1 + 1/2 - 1/3 + 1/4 - 1/5... n. This is what I've writte...
[2 replies] Last: haha my bad on that one. It wasn't, but I fixed it by changing the 1... (by btoohey4)
reference to user is ambiguous
 
i am trying to inherit user class to staff,account&customer class but when i am trying to access the values of user it gives error #include<iostream> #includ...
[1 reply] : private: char username ; char name ; char pass ; stri... (by a10e29)
initializing Arrays within constructor
 
Hi all, I have a header file with a class and constructor. within the constructor I have two arrays. The part I am struggling with is writing a the main.cpp fil...
[3 replies] Last: #include <iostream> #include <stdexcept> #include <memory> struct po... (by JLBorges)
Getting duration units??
 
Hi, If you have a time_point , is there a way to find out what units of duration it uses? Thanks, Juan
[1 reply] : template < typename TIME_POINT > constexpr double ticks_per_second() ... (by JLBorges)
April 2016 Pages: 1... 1112131415... 23
  Archived months: [mar2016] [may2016]

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