General C++ Programming - February 2022

by RicoJ
Is this a name collision?
 
I was testing template specialization and below is fine template<typename T> void is_voi(T input){}; template<> void is_voi <char> (char input){}; But thi...
[15 replies] Last: Putting it into a header file, though, is a step too far ;) Yet that... (by George P)
How to have input parameters like std::vector
 
What I am aiming to do is to have parameters for a function be similar to std::vector where you choose the parameters and there is a minimum of 1 parameter. Tha...
[6 replies] Last: Point well made, Peter87. Weird, I typed class template originally,... (by George P)
Can anyone please translate this java code into c++?
 
working java code: /* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; class decode { p...
[7 replies] Last: translating is almost always a failure. - if the code is really small... (by jonnin)
C++: how create a HBITMAP with a pixels pointer?
 
see how i create the HBITMAP after load the image using GDIPlus: void FromFile(string strFile) { //clean all objects.. here i must update it, bu...
[13 replies] Last: "I think the alpha value should be the first value in the struct." hon... (by Cambalinho)
by frek
Multi-threading performance influence in effect (1,2)
 
I've just currently been to multi-threading and kept myself revolving around it to learn and get through that. A couple questions about the code below: #inclu...
[29 replies] Last: as well as, I'm rather confused about: first_val += N_PER_THR... (by frek)
Question at your disposal
 
Good evening friends I want to start programming a computer game in the first person Where should I start? Mean me please
[15 replies] Last: Godot is a very friendly game engine that exports to just about everyt... (by Duthomhas)
What's wrong with my code?
 
The objective of this program is to ask the user for the name of a data file. If the file does not open, exit the program. This data file contains a list of stu...
[6 replies] Last: Perhaps (not tried): #include <iostream> #include <iomanip> #includ... (by seeplus)
Converting bases
 
Hello, I am currently unsure on how to convert a binary base to a quantenary base. Here is a function I have written for decimal to binary conversions but any h...
[2 replies] Last: Yours is a conversion from any positive number, not any decimal number... (by mbozzi)
by frek
Converting method
 
If we've got a vector of hex chars, how do we print the actual English characters? I wrote this: #include <iostream> #include <vector> #include <cmath> #incl...
[10 replies] Last: Yes, exactly. Honestly I found it a little after posting the question ... (by frek)
MS Visual Studio Project hidden folder
 
I found a hidden folder in my project folder called .vs I removed it from my project folder and my program worked just as fine as before. So I was wondering w...
[4 replies] Last: The .pdb files are actually the 'database' for debugging and edit/cont... (by jonnin)
Making a vector of type class? (1,2)
 
Hey guys, I am having quite a bit of trouble making a vector of objects (specifically with using classes). So I was wondering if someone could give me a semi...
[37 replies] Last: Have no fear! My time spent has been for self interest to see if the F... (by againtry)
2D array to include multiple elements per index
 
I need a 2d matrix that points to 2 values from every row and column index. For every mat(index x,index y) I want to access age and waist circumference. I consi...
[10 replies] Last: What is the significance of OpenCV in this thread, BTW? It stores thi... (by technologist)
Help with C++ GPS Program
 
I have this code for reading a GPS file. It's running, but the output isn't correct. I really need help with the algorithm for the total distance traveled. the ...
[8 replies] Last: #include <iostream> #include <iomanip> #include <fstream> #include <s... (by lastchance)
how can i win speed on SetPixel\GetPixel?
 
heres my image.h: #include <iostream> #include <string> #include <string.h> #include <windows.h> #include <math.h> #include <vector> #include <gdiplus.h...
[12 replies] Last: thmm (590): i have used, but no luck.. i can use DIB's.. i will do ano... (by Cambalinho)
Google Tests with cmake
 
Hi, I have created a basic gtest project, using cmake to compile and test my code. however, i now want to encorporate an external (build) lib into my project...
[no replies]
by SSDEEZ
Linked List insert
 
I'm trying to make an insert function for a linked list. It needs to insert at the end of the list and not traverse if the head node is the only node in the ...
[2 replies] Last: If you need to insert at the end of a list, then it's common to also h... (by seeplus)
coding a 2D array rolling algorithm using WASD keyboard control
 
I want the program to initialize the 6x24 array with the pattern and display a static image on the console screen upon startup. And the six user control command...
[1 reply] : Also here on your other thread. https://www.cplusplus.com/forum/beginn... (by salem c)
Beginners program - college
 
#include<iostream> #include<iomanip> #include<conio.h> class flag { int n, freq, i, a , ele; public: void read(); void find(); ...
[2 replies] Last: #include <iostream> #include <algorithm> constexpr size_t MaxArr {1... (by seeplus)
Calling Perl Methods/API from CPP
 
Problem : Create a single object of the perl(Moose) class defined below. Don't create the object more than once. Using the object call the three methods with p...
[1 reply] : Are you ASKING how to call Perl methods from C++ code? Copy-'n'pastin... (by George P)
reading CSV file into Array
 
Good Day All Been programming in C now learning C++.Can any body advise me to scan a CSV file with "EM305","Front Door Entrance Reader","7h30", "16H30","S2010",...
[3 replies] Last: Do you know how to open a file, test to see it was successfully open, ... (by George P)
February 2022 Pages: 123... 5
  Archived months: [jan2022] [mar2022]

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