Beginners - June 2022 (Page 5)

passing via object vs passing via return
I have two short code examples here. I am instantiating a class and using it to return the sum of two numbers. One pass back the result as a variable in its cla...
[12 replies] Last: OK. That makes sense. Thanks fritz (by fsonnichsen)
by tonic
c++ Source for select()
Hello guys, i dont have a good understanding of select() and since im working with sockets lately i need some better understanding of it, can u provide me some ...
[8 replies] Last: If you want to learn network programming, using the sockets library is... (by kbw)
Variable Diagrams
Draw variable diagrams for the following program with input values 2 (for variable first)and 3 (for variable second). For instance: •A ? shows an uninitializ...
[1 reply] : Shouldn't it start with: L19 first ? second ? L21 first = 2 second ? ... (by seeplus)
addition modulo 32
Windows 10, Visual Studio 2019, C++ I am working on some code that will include SHA-256. In my readings about it, articles mention the use of “addition modu...
[7 replies] Last: > Using those makes the intent absolutely clear and does not change fo... (by JLBorges)
assign four array items to one int
I have array of four items: a , a , a , a I want to assign these four to one int: no problem to assign two items like array[ row ][ column ] = id; is there...
[6 replies] Last: I did it for combinations, to get all possible combinatios, excluding ... (by impetus)
sorted array, exclude duplicates
I need all 4 items be equal as per below, to make condition true it is actually true when any part of below is equal. How can I ammend the code? if (a...
[7 replies] Last: Oh! I finally found slight mistake on function entry, but statement f... (by impetus)
Loops are causing mayhem in the code.
I was working on this logic to sort 2D arrays when I came across a problem. For some reason, the compiler would freeze up when it attempted to do so. I had this...
[4 replies] Last: The output is a bit "strange," courtesy of the (il)logic of the nested... (by George P)
Interface to access elements without breaking encapsulation
Hi I am designing a library which will store data supplied by the user. I would like for the user to be able to change or delete these objects. But I am cons...
[7 replies] Last: thanks everyone, very helpful (by rozick1)
Finding prime nodes in binary search tree
Idk any ideas about finding primes node =(( #include <iostream> using namespace std; struct node { int info; node* left, * right; }; ty...
[4 replies] Last: finding primes and searching them would be a lot of searches (fast as ... (by jonnin)
by Geckoo
Buffer size using a parameter
Hello everyone. Is there a way to set a buffer size using a function argument? I don't understand why it is not possible. I guess that it is a way to avoid buff...
[15 replies] Last: If buffer is going to be initialized after allocation, then from C++20... (by seeplus)
Report Card
Write a program that prompts the learner to key in their marks for each subject. The program should include the following functions: a.A function studentDetails...
[17 replies] Last: Thanks all , you've all been helpful and I learned a lot (by blackpanther35)
str_buf.length doesn't reach the end of my loop
Hi, I am using buf.end. My code inserts a return character \r to a string. It works like it should but it stops before the end of the file. Notice the 300 in t...
[3 replies] Last: Thanks JLBorges and seeplus. @seeplus. Your suggestion makes sense an... (by Cyclone)
use memcpy for pcie burst
Hello there! i have designed a system of pcie root complex using zcu102 xilinx board. i wrote drivers on the processor side as well that initialize, read an...
[1 reply] : this should be done using DMA, not memcpy. Memcpy will work, yes, but... (by jonnin)
Estimate relative costs of two routines
Greetings! For a physics inspired numerical method, I want to estimate the relative computational cost of two routines, one used for energy evaluation, one for...
[8 replies] Last: good. just note that its crude, as we said. The biggest thing is tha... (by jonnin)
June 2022 Pages: 1... 345
  Archived months: [may2022] [jul2022]

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