General C++ Programming - February 2018 (Page 10)

Is my method of void replacement bad idea?
 
Since I really don't like exception throwing, I came up with the idea where instead of a void I return class PorcessInfo. ProcessInfo is a class which contains ...
[2 replies] Last: Just be sure you won't go further developing your ideas until after an... (by barnack)
General gui design workflow for newbie
 
My question on Stackoverflow was blocked/closed/whatever because it was to unspecific but as a newbie I feel the need to ask for the bigger picture rather than ...
[13 replies] Last: Its more of an experience thing, its hard to give a tutorial on a big ... (by jonnin)
by stav
derived class reference to derived class
 
Hi I have the following code: #include <cstddef> #include <iostream> #include <vector> class Entity; std::vector<Entity*> entities = std::vector<...
[2 replies] Last: In addition, the code has undefined behaviour because Entity does no... (by JLBorges)
WndProc is Undefined
 
I'm reading through a DirectX 11 book and with a block of code within the book keeps throwing me an error... int WINAPI wWinMain(HINSTANCE hInstance, HINS...
[2 replies] Last: I suggest you get a book (or more) on creating Windows applications fi... (by closed account E0p9LyTq)
searching a word
 
Given first term (a), common ratio (r) and a integer N of the Geometric Progression series, the task is to find Nth term of the series.
[1 reply] : What is the question ? (by SamuelAdams)
incremental sort
 
Given a stack, the task is to sort it such that the top of the stack has the greatest element. Input: The first line of input will contains an integer T den...
[1 reply] : when writing your comparison for the std sort routine, you can make it... (by jonnin)
Read access violation in dynamic stack implementation
 
#include <iostream> #include <conio.h> using namespace std; struct Node { int info; Node *next; }; Node *top = nullptr; Node *np = nullptr; No...
[3 replies] Last: np->next = top; top = np; top->next is never NULL, so you don't kn... (by kbw)
by urko18
Robotic arm torque control (1,2,3)
 
Hello everyone, I am an engineering student and I am doing my final career year practices. In these practices, I have to implement the control of a robotic a...
[47 replies] Last: Thanks doug4 !! Ok, I've already corrected the comment that I was mis... (by urko18)
by mynava
Issue calling counter loop function in main
 
Hello, I am currently stuck and unable to get the proper results for my program. Part of the assignment is to count and print all even numbers from an array. I ...
[4 replies] Last: @Misenna - that was it!! My the program is working perfectly now. I kn... (by mynava)
Need help please
 
Hey guys, My program asks for a physics mark and outputs the mark as a percentage. I'm stuck on making sure that the mark is not below 0 or above 100. I've tri...
[1 reply] : 1. See lines 25 and 33. OR is || AND is && 2. See lines 15 and 33 - ... (by lastchance)
Throwing values to Matrix Class?
 
Hello professionals, I tried throwing values to these Matrix44 class function but I failed... #include <iostream> #include <cmath> template<typename T> cl...
[3 replies] Last: Thank you @JLBorges. :) (by kindgnice)
Do not understand why declval<T> just adds an rvalue reference to T...
 
Hi, I am reading the following which is not clear to me: "For referenceable types, the return type is always an rvalue reference to the type, which allows...
[13 replies] Last: > which compiler do you use and which OS? These days, I use Windows f... (by JLBorges)
SDL_TTF installation?
 
I can't for the life of me figure out how to install this thing. One tutorial says that I'll find the files I need in the i686-w64-mingw32 folder - notably miss...
[2 replies] Last: That's what I downloaded. Is it in one of the subfolders? I didn't see... (by DiamondWolf)
Bitwise operators changing my type?
 
Greetings, i'm doing some bitwise operations concerning console colors. I've the following enum: static enum color : __int8 { blue = 0b00000001, gree...
[10 replies] Last: Ok, thanks! @Peter87: i'm using unsigned char (by barnack)
by NG99
NG99
 
#include <iostream> #include<cstring> using namespace std; int main() { char s1 ="Pokemon",s2 ="Pikachu",s3 ="Raichu"; cout<<"B= "<<strcmp(s...
[2 replies] Last: Please read the description of strcmp and strncmp. Then tell us what y... (by dhayden)
Container List
 
How do I import/read variables from a text file into a list? creat with container list or forward_list.
[1 reply] : Basically the same as here: http://www.cplusplus.com/forum/general/229... (by Thomas1965)
Spherical Coordinates for Shading only in CG?
 
In computer graphics, it was mentioned in this link https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/geometry/spherical-coordin...
[no replies]
by WildB
Need help finding the maximum, minimum and average of the sales amount(from a file) without using an array.
 
#include<iostream> #include<string> #include<fstream> using namespace std; enum MonthType { JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC }; Mo...
[6 replies] Last: Thanks I test this out when I have the time(probably tomorrow). Also t... (by WildB)
error: no match for operator
 
void InitializeGame(int dim) { // Initialize board memory char board = { {'r', 'n', 'b', 'k', 'q', 'b', 'n', 'r'}, {},{},{}...
[1 reply] : cout<< board ='p' ; You're trying to assign an index and print the... (by Ganado)
by znyk
assembler in borland c++ 5.5
 
Welcome I use borland compilator c++ 5.5 under Windows 10. When I compile programme including assembler I have error: Warning W8002 MAIN.CPP 31: Restarti...
[2 replies] Last: You also need Borland's assembler, TASM, which did not come with the c... (by Duthomhas)
February 2018 Pages: 1... 891011
  Archived months: [jan2018] [mar2018]

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