General C++ Programming - April 2021 (Page 2)

Problem 2
 
I am trying to write a code with for nested loops but the problem I have is with alignment meaning it does not align properly. Does anyone understand ...
[9 replies] Last: @Bill2345, Out of curiosity, what is this for? Just experimenting, ho... (by JRManx)
which attribute syntax should i use ("[[gnu::attr]]" or "__attribute__ ((attr))")
 
__attribute__ ((pure)) int foo() {return 2;} [[gnu::pure]] int bar() {return 2;} Both of those attributes do the same thing the second one is not ...
[2 replies] Last: Prefer the latter because it uses the standard attribute syntax. (by mbozzi)
I am having trouble with this. How to properly do this?
 
I need some help with this, please. The directions were: Expand the payroll program to combine two sorting techniques (Selection and Exchange sorts) for bette...
[12 replies] Last: In fact, it is maximum and minimum net pay for all employees. I just m... (by ITStudent101)
dynamical programming and recurrent descent
 
I have a task and solution. How can I solve it with the help of dynamical programming or recurrent descent? #include <iostream> #include <string> #include ...
[1 reply] : http://www.cplusplus.com/forum/general/277529/#msg1197994 (by lastchance)
Reading integers of unknown length correctly.
 
I am writing data to a file (using fprintf) and then reading it back in (using fscanf). The result of this program is: i(12)=12462 j(462)=0 c(D)=D With t...
[5 replies] Last: Thank you for the responses. Looks like option 1 is the way to go. M... (by phalangium)
Building a Peer-to-Peer Multiplayer Networked Game
 
Hey guys! I'm looking to make a game with a peer-to-peer server, and for that I need a c ++ library. Look at this site, it can help with what I'm trying to expl...
[no replies]
Help with code that won't compile?
 
Apologies in advance for my limited experience with c++ (I'm learning). I'm writing a dll that needs to return an array of ints to the calling application. I h...
[1 reply] : Turns out I needed to change the setting under the Property Pages ->... (by coldscooter)
by mouch
Can you help me with this c++ code?
 
I did a code that allow to register students 2-show users registered 3-order users registered by code and 4-search for an user by code. My problem is in the ste...
[7 replies] Last: Oh I see, thanks for the explaination @jonnin. (by mouch)
Array based Binary Tree Implementation
 
Hello, I am new here so please forgive me if I'm doing something wrong. I was given an assignment where the requirement was to fill out a binary tree class u...
[3 replies] Last: the easy way to do this is to just exchange array location index where... (by jonnin)
create thread with function taking vector argument fails
 
I'm creating a thread to run a function sample(vector<double>&) and compilation give me errors. I don't understand the error messages. Any help is appreciated. ...
[4 replies] Last: It's in the documentation. https://en.cppreference.com/w/cpp/thread/th... (by mbozzi)
deleted
 
This is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made ...
[1 reply] : ...And the OP is gone. https://www.cplusplus.com/forum/beginner/277696... (by JRManx)
how i make list in a new class on c++
 
guys I need help in this exercise mainly after the letter d) in the creation of another class, here is the first class I did in a header file Statement of th...
[1 reply] : @BrennoPedroso, PLEASE USE CODE TAGS (the <> formatting button to th... (by JRManx)
String Compression C++
 
I am trying to solve the question to make a C++ code for the question given at the link https://fizzbuzzer.com/better-compression/ The question is restated a...
[8 replies] Last: Thanks. I have understood the solution and learn sstream and auto from... (by abcdef123)
Passing an array of a structure to that structure's functions
 
I'm having problems with line 61, but let me tell you what is supposed to be happening: I have a structure called 'member', and have created an array of this da...
[6 replies] Last: Yes, that. One does not "copy/paste it into the c++ compiler program ... (by keskiverto)
How to convert a number into an array of single digit integers?
 
The input should be a number (entered in one line) like 83809684986986904 (the number is not less than 13 digits and not more than 10^5 digits). I want to mak...
[3 replies] Last: #include <iostream> #include <string> #include <vector> using namespa... (by lastchance)
Help in understanding this program
 
Hi, I wanted to know how this program actually works: unsigned int f1(unsigned int a, unsigned int b) { if (a == 0) return b; else if (b == 0) ret...
[5 replies] Last: Hey, @dhayden, thanks! That really helped me understand recursive fun... (by JRManx)
Program isn't outputting a text file's parsed info
 
Good afternoon! I am attempting to read information from a file using getline() but the information is not outputting correctly. I believe there may be an issu...
[2 replies] Last: Perhaps something like: #include <iostream> #include <fstream> #inc... (by seeplus)
Read the data from the files and giving the correct answer
 
I need help understanding what I'm doing wrong in my coding(c++). The program should then display the number of times that team has won the World Series wheneve...
[6 replies] Last: Based upon original method, then perhaps: #include <iostream> #incl... (by seeplus)
Play online radio in C++
 
Hello, this is my first post here! I've seen other questions similar to mine, but I could not figure out how can I play a sound from an online radio in C++ ...
[12 replies] Last: The HTTP headers can say anything they want. It doesn't necessarily co... (by helios)
Error upon using uniform_real_distribution
 
Hey Guys, its me again. i have written a Random class that wraps the mt19937_64 class to be used in a more simple way Everything works as intented, with the ex...
[19 replies] Last: @helios i might try that in the future, but for now i will implement t... (by JustShinigami)
April 2021 Pages: 1234... 8
  Archived months: [mar2021] [may2021]

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