General C++ Programming - February 2022 (Page 3)

Is there a way or function to check if a float is assigned a value to?
 
I want to find the max and min value from numbers of a csv file. I don't know the range of the value...
[1 reply] : Assume that the numbers are of type float, then you can use these for ... (by seeplus)
How do I populate my vector that is located in my struct? See the 2nd to the last for loop
 
#include <iostream> #include <vector> #include <string> using namespace std; struct Ingredien...
[12 replies] Last: The actual assignment was to: 1. Create a recipe struct 2. Create a v... (by seeplus)
by ttpjd1
Issue with C++ dispatch to base
 
Please forgive me if I fundamentally misunderstand something about dispatch in C++! The code as p...
[1 reply] : This compiles: #include <iostream> class Something {}; class Somet... (by seeplus)
by frek
Lambda
 
1) Why is not the lambda inside the function called, please? #include <iostream> void test() { in...
[9 replies] Last: @ frek, a book on lambdas I found useful is Bartłomiej Filipek's "C++... (by deleted account xyzzy)
I need to generate a unique random number everytime a user press y
 
#include <iostream> #include <time.h> #include<windows.h> using namespace std; int main () { ...
[5 replies] Last: No, there is no need to remove any of the elements, from the front or ... (by deleted account xyzzy)
What would be the best strategy for grouping these objects together? (vector, array, etc)
 
My question is what would be the best way to organize objects(both the initial 12 and the offspring ...
[1 reply] : its up to you. KISS suggests you just have your class be critter-type... (by jonnin)
by Cplusc
byte is ambiguous
 
Hello, I am including one dynamics library in my visual studio 2017 project and I am getting this er...
[12 replies] Last: It might not hurt to consider upgrading from VS 2017 to VS 2019 or V... (by deleted account xyzzy)
how use Multithread?
 
i did these function: void GetPixelImage(HDC HDCOrigin, int PosX, int PosY, COLORREF &color) { ...
[2 replies] Last: This is also the case with (the bind expression created by) std::bind... (by JLBorges)
Is there an issue with my code?
 
I created this code. It runs as expected, but something seems off. #include <iostream> #include <c...
[2 replies] Last: #include <iostream> #include <cmath> #include <cstdlib> #include <cti... (by againtry)
by R3shY
DXGI Adapter RAM to String?
 
Hey im trying to get dedicated VRAM as a string with DXGI from example: https://github.com/walbour...
[1 reply] : Since we've no idea what you tried, how you printed it, what you saw, ... (by salem c)
Returning the result of an expression stored in a c-string
 
Hey yall, So my assignment has once again brought me here because I am not able to figure this on...
[4 replies] Last: short myType::Calculate(myType& Math) { Math[ Math.size()+1 ] = '... (by keskiverto)
by Cplusc
Failed to launch mpi.exe
 
I am running a code with 64 processors using mpiexec -np 64 mpi.exe, but I'm getting the error "fail...
[2 replies] Last: Thanks for your answer. (by Cplusc)
Why is My output rounding down
 
I have a program that outputs a list of numbers. The program is working, but the output is supposed ...
[6 replies] Last: If the standard library is being used, nth_element is ideal for this... (by mbozzi)
Preprocessor OpenGL c++ issue (1,2)
 
EDIT: I HAVE UPLOADED A VIDEO SHOWING THE PROBLEM https://youtu.be/uWlSUxxMy08 AND https://youtu.b...
[27 replies] Last: 2010 doesn't support the latest C/C++ standards. *PTUI!* Actually it... (by thmm)
Is the curiosly recurring template pattern recursive?
 
Hi, In this definition: template<typename T> struct ordered { bool operator>(T const& r...
[5 replies] Last: no, it does compiles because of your weird bogus -> ordered<Int> inh... (by ne555)
how do you find the median in c++
 
from smallest to largest this is what I have if(grades < grades && grades < grades && grade...
[1 reply] : Yes, there's a general-purpose sort: https://www.cplusplus.com/referen... (by lastchance)
get index of smallest number of array
 
hello I'm trying to get the index of the smallest element of an array, IF this element index satisf...
[3 replies] Last: hey guys. I'm using it to choose positions for buildings in a grid. th... (by Stauricus)
No matching constructor for initialization error
 
//header file with constructor initialization within the StudentClub class class StudentCl...
[3 replies] Last: I this homework where you need to do things in a certain way ? If not ... (by thmm)
by frek
Simple bit set example
 
In this piece of code: #include <iostream> template<typename T> void print(T t) { std::cout << t ...
[3 replies] Last: ... (by seeplus)
by frek
Text editor for socket programming
 
I'm about starting learning C++ socket programming. For that a compiler like GCC and an OS like Ubun...
[4 replies] Last: Twice have I had application that needs to transfer data. First time w... (by keskiverto)
February 2022 Pages: 12345
  Archived months: [jan2022] [mar2022]

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