General C++ Programming - April 2022

by ardsio
How to update data to members of a structure
 
I have a large structure defined that I need to regulary update the values to the members. Now I have in my update function: sMyStruct.Member1 = Update("Mem...
[19 replies] Last: kigar64551: The SimConnect_SetClientData function is used to write on... (by ardsio)
by frek
C++ TEA algorithm confusion
 
I'm going to use the C++ TEA algorithm in an application. Unfortunately I couldn't find a C++ complete version of that algorithm with good comments throughout i...
[5 replies] Last: @frek The wikipedia article @salem pointed to is all I needed. Unless ... (by againtry)
how can I write this C++17 in c++14?
 
I have this code that compiles perfectly in C++17: #include <type_traits> template<typename T, typename ...> struct first_arg { using type = T; }; templ...
[1 reply] : First problem is that std::conjunction is not part of C++14. Second ... (by mbozzi)
by Cplusc
build solution using cmake command in cmd
 
I'm trying to run the following lines using command prompt in my source file directory. mkdir build_dir cd build_dir cmake \ -D CMAKE_BUILD_TYPE:STRING=DEBUG...
[12 replies] Last: Those are line continuation characters. They're used by the shell to ... (by kbw)
C++ Final exam
 
What help? You haven't asked a C++ question. You haven't posted your current code or stated what issues you're having with your code. Nobody here is going to w...
[1 reply] : That didn't last long. (by kbw)
Problem with stack
 
Hello, I am trying to write a Tower of Hanoi program using exceptions. I was a little unsure about how to store the disks in each tower so I used stack/LIFO. Bu...
[11 replies] Last: [quote=spinach999]unfortunately some of the programming language used ... (by George P)
HANGMAN USING LINEAR SEARCH AND SELECTION SORTSORTING
 
i need help creating hangman with selection sort/Insertion sort and linear search algorithms
[14 replies] Last: As a first refactor, consider: #include <iostream> #include <iomani... (by seeplus)
isPalindrome()
 
I need help to create a function() in QT5 using QString to check if a sentence is a palindrome and must say Yes if it is and no if it is not. important it must ...
[16 replies] Last: Parseltongue?? (by seeplus)
by omy
[MS Detours] Passing function as parameter, Identified undefined
 
Hi, I am trying to hook a function with Detours 3 and have the following code: // dllmain.cpp : Defines the entry point for the DLL application. #include "std...
[3 replies] Last: I am using VS2017 There are newer versions of Visual Studio availabl... (by George P)
How to get proper result for Escape Velocity?
 
Hello, I am doing a project where I need to find the escape velocities for given planets. I have a formula ready, but it keeps showing me only 0. What is wrong...
[11 replies] Last: I think @againtry's code is a rather better starting point than an unr... (by lastchance)
need some help to understand this code
 
I am new in c++ coding in this chapter I can not understand the meaning of " mask = 0x4<<16;"
[4 replies] Last: 0x4 << 16 means take the hex number 4 (which is 100 binary) and shift ... (by seeplus)
Quad Trees where to start?
 
Hello, I was tasked by my teacher to make a quad tree in c++ that takes points and says how many points are within the box, but I don't know where a good place ...
[6 replies] Last: You can not read entire C++ objects from a file or write them to a f... (by kigar64551)
C++ program that converts word or name to ICAO. Wont print my ICAO results.
 
This is my code that I am struggling to get the results (ICAO words) printed. My code has to use functions, have a user menu, and cant use arrays. Whenever I do...
[2 replies] Last: Functions can take arguments and return a value . See http://www.cp... (by keskiverto)
Abstract declarator used as declaration
 
Hi, I'm trying to study for my second test tomorrow and I'm just doing out of the book programming challenges, I can't get my code to run because I'm getting th...
[10 replies] Last: A class compiles down to the same thing as a struct. The member variab... (by Peter87)
by frek
The longest substring
 
The purpose is to find the length of the longest substring in a given string for which I wrote the inefficient algorithm below: #include <iostream> #include <...
[5 replies] Last: at that point you have half or so of the low hanging fruit ... so many... (by jonnin)
what does this print?
 
1) void fun(); void main() { int x = 1; fun(); printf("%d", x); } void fun() { int x = 2; ...
[18 replies] Last: @keskiverto, I tried the OP's code as given, as C code, in both VS 20... (by George P)
by Cplusc
cmake
 
I am trying to build clapack and run to a problem that I can't figure it out. After running the following line in cmd cmake -G "Visual Studio 17 2022 " -T ho...
[4 replies] Last: @yanson Thanks , I tried -DUSE_BLAS_WRAP="yes" before posting the ques... (by Cplusc)
what does this print?
 
1) void fun(int *p); void main() { int x = {3,2,1}; fun(x); printf("%d", x ); } void fun (int *p) { ...
[2 replies] Last: what does this print? I refer to my answer here http://www.cpluspl... (by seeplus)
what does this print?
 
1) int fun(int p); void main() { int x = 3, y = {1,2,3}; y = fun(x); printf("%d %d", x,y ); } int fun (int p) ...
[5 replies] Last: what does this print Put the code into a file (or use an IDE), comp... (by seeplus)
How to get Balance for 8.5?
 
Hello, I currently have a program to give me a line for the best fit of the y(Balance) graph. But I am also trying to find how much the Balance is on week 8.5. ...
[3 replies] Last: #include <iostream> #include <fstream> #include <vector> #include <cm... (by lastchance)
April 2022 Pages: 1234
  Archived months: [mar2022] [may2022]

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