General C++ Programming - November 2020 (Page 3)

Is a number prime
 
Hello I got a task, and I don't have any idea how to do it. Maybe you can help me? There is given a whole number (that you need to insert by yourself using t...
[2 replies] Last: #include <iostream> #include <iomanip> using namespace std; int ma... (by grooviqw)
by colt
Two first values of the matrix change after last function call.
 
Two first values of the matrix change after last function call. Hello. I have a matrix MxN, whose two first values (matrix ,matrix ) became "dirty" (change...
[1 reply] : here two output examples (they didn't fit the first message) matriz... (by colt)
Contour
 
Given a two-dimensional rectangular array of NxM numbers. Find the smallest number in the first column or last row. Any ideas how to find the smallest number ? ...
[3 replies] Last: If n = m = 1 then x is the answer to both questions. (by againtry)
Why is 64 bits the largest primitive
 
Hi guys, So I could be wrong, I'm guilty of using mostly C++98 mainly when I program. I have read that you can indeed have larger primitives than 64 bits(I thi...
[6 replies] Last: yes, many programs use larger than 64 bit integers. Its not hard to ... (by jonnin)
Intersection and Difference in a Set.
 
I need someone to explain to me how to implement Intersection and Difference in a Set. I know how to do the Union but I'm stumped on the other two. I also need ...
[5 replies] Last: Thank you all so much for your help. (by Happy2bhere)
An array without a size
 
The data file contains a sequence of numbers of up to 10 elements. Find the minimum and maximum of the sequence. Note that the array size is not specified! ...
[2 replies] Last: Thanks! (by neonblue00700)
want to calculate all score average
 
hi, I already get the score average but now I want to calculate all the score average of the students but I'm stuck at it #include <iostream> #include...
[2 replies] Last: okay i got it tq (by Safiah243)
quarter of a one-dimensional array (1,2)
 
Hi guys, how can i get the 3/4 of one-dimensional array(vector) in a program?
[20 replies] Last: It's not when you say what is required. #include <vector> #include ... (by seeplus)
by mnm71
How to handle connection reset by peer?
 
In this program, when I want to connect several clients to the server, for example, 10 consecutive connections, from some connection I get the connection is res...
[5 replies] Last: if you lose connection, you need to detect it and then attempt to reco... (by jonnin)
Hexadecimal number insertion inside a larger one
 
i want a constant const int hex_numb; and how do you define a hexidecimal number in int format? Then i want this const to be prefixed or suffixed on a large...
[2 replies] Last: this comes back to what I said before, a number IS a number. there is... (by jonnin)
Can you use std::hex outside of a cin/cout <<
 
instead of #include <iostream> int g = 70; cout << std::hex << g << "\n" ; //instead like this int h = 30; int hex_num = std::hex(h); cout << hex_num << "\...
[2 replies] Last: int hex_num = std::hex(h); This implies something more important: tha... (by jonnin)
sqlite3: database keep locked by a function
 
I made a simple C++ program with sqlite3, it's composed by several function in which in each function I open the database at the begin, and i close it ad the en...
[1 reply] : So why don't you add a database_close(db) to your find_user function? (by salem c)
Can someone tell me why my code isnt working
 
//contents of Numbers.h #ifndef NUMBERS_H #define NUMBERS_H #include <iostream> using namespace std; class Numbers { private: double *arr; int...
[2 replies] Last: Yeah i am lol but yeah thank you for fixing it. It works for me now (by roccosd26)
by hg2555
Create a webpage to record a video stream
 
I have a C++ program that reads a video from a camera (using OpenCV)and sends it to a Web server. I can see the video stream in a browser. Now I want to add r...
[4 replies] Last: Yes, it is not for multiple users. It is just a small application with... (by hg2555)
Vector append & merge
 
For one way to do these, consider: #include <vector> #include <iostream> #include <algorithm> #include <iterator> std::vector<int> append(const std::vector<...
[2 replies] Last: OPs can't delete their own posts after being replied to. Someone else ... (by Ganado)
Reading large values from text
 
hello i had a problem reading file. in the text there are a huge number. This numbur is 37107287533902102798797998220837590246510135740250 how can i read ...
[8 replies] Last: The OP doesn't actually need to split up the input - as long as he/she... (by lastchance)
"if" inside a do-while
 
Hello guys, i have a silly question. I'm doing an exercise where i need to countdown an user input value to 1 and need to print "Beep" every time a multiple of...
[2 replies] Last: @Ganado Thanks so much! i knew that was silly.. i have tried to move ... (by Lebrown)
by BZKN
return value in a C function
 
Hello all, Please excuse me for asking C programming question in a C++ forum. As we know you can't return arrays from functions in programming language...
[7 replies] Last: all fine now....I agree what you said. I will avoid cross-post. And i... (by BZKN)
No spaces between text after merging files
 
Hello all, I'm back again. Theres this issue within my code, but I don't know exactly where the issue is. The mergeFile function() takes two txt files and m...
[3 replies] Last: Also >> std::noskipws so whitespace is not skipped on stream extractio... (by seeplus)
by Hanske
Boost serialization - input stream error
 
I am trying to load serialized content and I have been unable to solve the issue. I have boiled it down to a specific line of code. I tried to minimize the code...
[9 replies] Last: Honestly i'm not sure what the problem is? If I but change the `load... (by coder777)
November 2020 Pages: 12345... 7
  Archived months: [oct2020] [dec2020]

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