General C++ Programming - January 2021 (Page 3)

by Ocko91
sorting rand arr[]
 
Hi C++ ; I have 5 random arr; how can I sort this 5 random numbers from less to high ? Thanks; int n ; for (int i = 1; i < 6; i++) { cout << " line " <<...
[5 replies] Last: the idiotic lazy way (a specialty of mine, I think 2 of my professors ... (by jonnin)
by frek
Is it reasonable to abandon raw pointer in favor of smart pointers in modern cpp for all programs
 
Hi people, I think with presence of good features, smart pointers deliver to us it's time to abandon raw pointers usage for all programs! Why not? Needles...
[14 replies] Last: now, that I can agree to, it sounds like a good place to work ^^ and y... (by jonnin)
by frek
My simple vector, myVec (1,2)
 
Hi guys, Please take a look at my simple vector below. I have got two questions: 1) Is the code correct, please? 2) Is the code written professionally "up to t...
[30 replies] Last: A struct is a class and a class is a struct! The difference between th... (by seeplus)
Is there methodology for cache-efficient algorithms and data structure?
 
Dear experts I am interested in high performance computing. Sometimes I wonder if in-depth performance bottle neck is in memory access, which is partly resolve...
[12 replies] Last: Dear all, Thank you for your profound opinions. In addition to cache... (by Mitsuru)
Help
 
I somewhat of an idea on what I'm am doing, but could use some help. I do have a few questions, but I want to try to figure most of them out. My first hurdle is...
[5 replies] Last: This is kind of what I was looking for. Thank you! (by Awak3nDreams)
Convert a 4-Bytes binary file 1024x1024 (.dat) to a matrix floating (.txt)
 
Hello Everyone! I am in my master degree starting in image processing. I have a .dat 4-bytes 1024x1024 binary file, I need to read this aiming multiply it aft...
[9 replies] Last: You right. Done! (by DanielDeChamps)
problem in C++ program
 
hey guys ! i am having a problem to write C++ program plz help me to solve it. Write a program that sums the first n items in a geometric series using a whi...
[2 replies] Last: or use your previous knowledge Break out your algebra book and find ... (by dhayden)
C++20 volatile warning
 
Good day! :3 I am using GCC 10.2.0 from MSYS2 on Windows. Recently I moved one C++ project from C++17 to C++20, and the problem with GLM library occurred. Lib...
[5 replies] Last: Note in C++20, some previous uses of volatile have been deprecated. Se... (by seeplus)
Compiling a shared library
 
Dear Community! Concerning a topic that deals with the compilation of a program written in C++ i would like to ask for your support. Just for information ...
[no replies]
Converting string to int for switch manipulator
 
The question is this that I have to ask the user a month and according to the month I have to set a hoursMax value. I need the user input to be in string but th...
[6 replies] Last: As was suggested by gaxio, why not just a simple map? As an example, c... (by seeplus)
by Alimaz
How to open an excel file and save it as a text file
 
Hi everyone! I just want to open an excel file and save it as a text file. I think it would be simple but i don't know it.( i want it for 1000 files and becaus...
[5 replies] Last: You can open an excel file as an object in c++ and then use the automa... (by seeplus)
Method for injecting code into application?
 
I'm wanting an example showing how to use injection to inject function code into a exe that holds a function at an offset and running the new injection code at ...
[1 reply] : This is what I came up with any thoughts on it would be helpful. // P... (by mecacool)
Finding number that 1-20 will divide evenly into
 
what sounds like a simple problem is giving me just that... problems within a couple of second I came up with the algorithm to get 2520(1-10) but when I try to...
[9 replies] Last: Okay...........Thanks, I guess?? (by adam2016)
overload operator '='
 
I have this: class foo { public: foo(){}; ~foo(){}; void* operator= (foo& f){return m_p;}; //getter foo& operator=(void* p){m_p = p; re...
[4 replies] Last: That is exactly what I need. It will make using this class much cleane... (by daytooner)
“Module was built without symbols” Error occurred when tried to opening a sample project
 
I am new to visual studio, I am trying to run a sample CPP code from a company which connects to DCAM API application. I have checked the version of VS in .sln ...
[3 replies] Last: The point of user4581301's comment on the Stack Overflow page was to f... (by Ganado)
String to Long Number Back To String
 
Hello! I was just asked a question that I need some help with. The question was given two strings that are numbers. Then add the numbers together (find the s...
[8 replies] Last: I have it done would be the best way to go about it? That's a goo... (by seeplus)
Multithreading Programming Problem
 
Hi guys ; I'm trying to solve as much as possible multithreading problems in regard of getting a job ; I've seen this problem of multithreading: https:...
[1 reply] : Also here -> https://cboard.cprogramming.com/c-programming/179981-thre... (by salem c)
which function is better calloc or malloc ?
 
It depends on what you want. calloc(...) additionally sets the memory to 0. See: https://www.cplusplus.com/reference/cstdlib/calloc/
[2 replies] Last: For C++? Neither, you should be using new. For C? Probably calloc sin... (by gaxio)
WriteProcessMemory function issue
 
I am trying to write to 2 memory addresses. This one "0x7def70" is for the 640 resolution value This one "0x7def74" is for the 480 resolution value But, when ...
[5 replies] Last: I'm pretty sure Windows has address space layout randomization. This c... (by gaxio)
by sheeda
Trying to create Arduino program with 7 segment displays
 
Hello all, I am trying to create a program that reads four letters at once from a user, then displays them on four 7-segment displays, with a delay between ea...
[2 replies] Last: 1. Use code tags when you post code. https://www.cplusplus.com/article... (by salem c)
January 2021 Pages: 123456
  Archived months: [dec2020] [feb2021]

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