General C++ Programming - October 2017 (Page 4)

by helios
Fast float type
 
Is there an analog to std::int_fastN_t for float? E.g. float_fast32_t. It doesn't have to be in std, just a library that provides such a type for a given platfo...
[7 replies] Last: Yeah, I've done fixed point arithmetic in the past. It's really fast, ... (by helios)
Publish/Subscribe Implementation - opinions
 
I have taken a look at an example published by makomweb on gist. I have taken the liberty to add some comments here: https://gist.github.com/jmjatlanta/36cb2...
[no replies]
I am a beginner in c++ and am pretty horrible please help me ;(
 
Write your question here. I am completely lost on how to create the loop for this program, its homework that is due tomorrow someone please point me in the rig...
[1 reply] : Here is an idea how those loops may work: //Note: initialiize variable... (by coder777)
Objects with Constructors
 
Question : WAP to create class Date having three private data members (day, month, year). Class should have (i) appropriate constructors (ii) member function...
[1 reply] : What exactly should the function int days(Date d) do? Should it calcu... (by Chervil)
Can you solve this problem using C++? (1,2)
 
Greetings fellow programmers. I would like to share a problem with you. There is a 7x8 grid that has gold coins in it. Each number represents the number of gold...
[25 replies] Last: Ooh! Fun! #include <iostream> #include <algorithm> int map = { 5... (by helios)
Void Recursion
 
Hi fellas, could somebody answer how can i END a void recursion? I said END, not return to the previous call, I want something similar to "break" in loops but d...
[7 replies] Last: Oh, I get it. The OP is asking to jump all the way through the stack b... (by Repeater)
Sentinel Loop Help
 
Hello, I'm not looking for you to write the code for me, I'm just looking to be pointed in the right direction. If you could provide a template or give some tip...
[1 reply] : It's a simple problem. I think you can handle it if you make a little ... (by IvanJobs)
Arrays of object doubt
 
Question : 2. Declare a class named ‘StudentRec’ with three private members: ‘enrolNo’ of type int, ‘CGPA’ of type float and ‘branch’ of type st...
[5 replies] Last: Yes, static has been done. Understood. There can be 2 solutions 1. Cr... (by abcdef123)
help with void function
 
Im doing this question for a class and im really confused on what im doing wrong can someone look over my code and guide me in the right direction here is the q...
[1 reply] : The compiler says: In function 'int main()': 37:45: error: 'GetTotal... (by TheIdeasMan)
Help with pi using classes
 
I am having trouble getting pi to output to the user by adding together my fractions that I have created. Here is my code. All of the math is working correctly ...
[8 replies] Last: Sweet I have the program working how I want it to. Thank you so much f... (by CHancock)
by sezo
assignment output issues (chessboard)
 
This is the assignment http://venus.cs.qc.edu/~waxman/211/fancy%20print%20chessboard%20assignment%20how%20to.pdf I'm having issues with the print: it is prin...
[no replies]
How to do time complexity table for binary search? (recursive and non-recursive)
 
Ok so I have to make a time analysis table for both of my binary search algorithms in my program. One is recursive and the other isn't. This is for a spellcheck...
[3 replies] Last: big-o does not generally use constants. no one cares if its log or l... (by jonnin)
callback function plz simplify
 
Hi, I am having some "stuckness" on the idea of a function, of the "callback type", as it differs from a "normal" function. I was kicking it around and it st...
[4 replies] Last: It is kind of like vectors (which are NOT vectors, in terms of physi... (by technologist)
by HArray
Fastest associative array on C++ (Trie) - Part2
 
Hi All, First part of the article you can find here http://www.cplusplus.com/forum/general/208418/ This implementation contains more than 8K highly optimiz...
[4 replies] Last: See: https://isocpp.org/std/submit-a-proposal Submitting it to boos... (by HArray)
Understanding the linker error LNK2019
 
I have recently starting working with visual studio c++ and I am getting LNK2019 error. I understand that it usually has to do with linking up libraries. I have...
[4 replies] Last: It's been several years since I've worked with Qt, but I remember that... (by MikeyBoy)
If Else Statement Help
 
Prompt for and read a single upper-case element symbol into char variable sym. Print the corresponding element and atomic number. Print an error message if th...
[5 replies] Last: Thank you so much!:) #include <conio.h> // For function getch() #inc... (by MisterBren)
by helios
POD assignment with no effect?
 
struct RGB{ byte_t r, g, b, a; }; //#define DEFINE_ME auto pixels = (RGB *)void_pixels; for (int y = 0; y < h; y++){ auto row = pixels + y ...
[13 replies] Last: It can be reproduced with MSVC 19.0 Original code - no optimisation: h... (by JLBorges)
by BJ19
What is wrong with my program? I need help.
 
#include <iostream> #include <iomanip> #include <string> using namespace std; void welcome(); void getInfo (string &, string &); int selectShape(); void getLe...
[5 replies] Last: double calcTotalPrice(int grade ,double squareFeet ) just like you ha... (by jonnin)
Graphical console apps
 
Hi all, What I know is that for graphics programming using C++ we need a library, whether that library is very strong and famous like Qt or not like FLTK. Rig...
[4 replies] Last: OpenGL is probably too low level to be practical. Yes, you're right. ... (by Frank14)
by Ozzy69
Can u help solve this problem in c++?
 
Make a program in C ++ to calculate the quadratic mean of n values entered by the user. The quadratic mean is given by the following equation: https://uploadde...
[1 reply] : soma += x^2; Do you know the meaning of ^ in C++ ? It's a bitwise o... (by Thomas1965)
October 2017 Pages: 123456... 16
  Archived months: [sep2017] [nov2017]

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