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

Find the average exclude 2 largest and 2 smallest
 
int nValues = {182, 163, 174, 155, 168, 160, 159, 168, 172, 180, 173, 171, 177, 175, 16...
[6 replies] Last: Seeplus, in your call to std::accumulate, shouldn't nsize-2 be nsize-... (by seeplus)
How to establish UDP to pass argv[]
 
Hello, my friends. I want to establish UDP between client and server. On the client-side, I initiali...
[1 reply] : > if ((numbytes = sendto(sockfd, argv , strlen(argv ), 0 So instead, i... (by salem c)
How to construct a adj-matrix
 
#include<stdio.h> #include<string.h> #include <stdlib.h> # define MaxVNum 100 using namespace ...
[3 replies] Last: Thank you very much! (by James ByeBye)
C++ struct 2 dimensional array
 
i faced a problem when i want to let user store their name, age, favourite word and favourite number...
[4 replies] Last: You haven't explained why you think it needs to be a two dimensional a... (by AbstractionAnon)
How to write program that reads a file and prints lines of symbols based on its contents?
 
I'm a beginner and am working on an assignment with the following prompt: "Write a program to read f...
[3 replies] Last: #include <iostream> #include <fstream> using namespace std; struct P... (by lastchance)
Makefile assistance
 
I'm having issue compile with make using a Makefile and g++. I have a simple header and source file ...
[2 replies] Last: Would you mind providing an example? Edit: Just did a test run, with ... (by lumbeezl)
Dev - C ++ - doubt in exercise C ++
 
The purpose of this system is to keep collectible items (books, CDs, DVDs and magazines), organized ...
[3 replies] Last: For me, it's always easiest to start with the data. Read the assignmen... (by dhayden)
having an issue
 
Working on an assignment for my C++ homework. Writing a loop that calls a function out of main in or...
[2 replies] Last: Sorry sort of new to this site. Also wow am I dumb. Thanks! (by idkwht2name)
How to construct an adj-list/adj-matrix from a txt file in c++
 
The input file like this (0 12 36.93222330340848) (2 8 785.7766177831124) I want to construct a weig...
[2 replies] Last: Thanks for your kindly help (by James ByeBye)
Algorithms with comparator
 
How can I make Coctail Sort with comporator? void CocktailSortTemplate(std::vector<int>& b, in...
[2 replies] Last: if( comp(c[i+1], c ) ) // c[i+1] < c thank (by onetwo123)
Been Having a hard time with arrays
 
Hi guys just want to ask how can I transfer the input in my array in choice 1 to the choice 2 I've b...
[6 replies] Last: thankful for you all help but just ignore it anyhow... cout <<... (by seeplus)
How to calculate time complexity of this code?
 
What is the time complexity for my code with showing your steps? I tried to figure it out by doing O...
[12 replies] Last: Start at the END of the array. (1) Search BACKWARDS for the largest u... (by lastchance)
by cernet
How to get good at reading code?
 
What are some good (small) git* projects that can be used for learning purposes? It is really diffi...
[8 replies] Last: Fair enough. Not sure if the constant reference applies more to the in... (by lastchance)
Incorrect result
 
Before I wrote this program with Stooge Sort and means of time was normal. Now I use Cocktail Sort b...
[2 replies] Last: Every experiment you time is sorting already sorted data Thanks!... (by onetwo123)
Recursion-
 
Hello everyone, I'm trying to understand Backtracking Algorithm. As I understand, Backtracking sh...
[3 replies] Last: In this example, I understand what is base case, choose, explore and ... (by dhayden)
Max value question
 
(Question)Write a C++ program that declares an integer array of size 10, then uses three separate fu...
[2 replies] Last: [quote=your_tutor]Write a C++ program that declares an integer array o... (by salem c)
CALLBACK EnumChildProc
 
#include <windows.h> #include <iostream> using namespace std; BOOL CALLBACK EnumChildProc(HWN...
[4 replies] Last: Thanks for answer, I mean that I will use them every time with changin... (by Hawlong)
The risk of wrapper class usage for std::vector<std::atomic<T> >
 
Dear experts I understand std::vector<std::atomic<T>> is prohibited, but there is wrapper class of ...
[4 replies] Last: Dear helios Thank you for your kind reply. Yes, I meant just reading... (by Mitsuru)
how to get a pointer to a struct's function
 
struct X{ int x = 3; int get_x(){return x;} int add_x(int i){return x+i;} }; int main() { X s...
[3 replies] Last: The C-ish way using function pointers. https://www.newty.de/fpt/callba... (by salem c)
by am2809
What is wrong with my toupper loop?
 
Hi, My program is running good I'm just having trouble with my toupper loop. Every time I run the...
[4 replies] Last: main() should return int, not void. It looks like you're trying to ... (by dhayden)
April 2021 Pages: 1... 5678
  Archived months: [mar2021] [may2021]

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