Beginners - September 2022 (Page 2)

Unexpected behavior 2!
 
Consider the code below: int total; std::cin >> total; int ary ; for(int i=0;i<total;i+...
[9 replies] Last: It's not as straightforward as it looks because it interferes with the... (by Peter87)
A linux for programming
 
I never used a linux OS, I am open to the idea of using it lately, what is the best linux for progra...
[18 replies] Last: Got it, thank you everyone) always honored. (by ninja01)
Work around for limitation of template virtual member functions?
 
Hi I have a Message class which other classes inherit from. The inherited classes will need to have...
[1 reply] : You could use some special-case code for each class, or exploit that T... (by mbozzi)
checking if the inputs are valid Palindrome
 
How can I make this program work to determine whether these 5 palindromes are valid or not? #in...
[6 replies] Last: thank you guys :) (by cplus2303)
building a multilayer perceptron
 
Hello, I want to implement a simple multilayer perceptron for digit recognition. I have started t...
[9 replies] Last: @dvdlly, I am well aware that the code you provided is a header file, ... (by lastchance)
Unexpected behavior 3!
 
In the following code it is clear that ptr holds an address int nbr = 3; int *ptr = &nbr; st...
[6 replies] Last: [quote=jonnin]some embedded systems expect you do to this (but their l... (by Peter87)
Binary search of a dynamic array of strings
 
Hey yall, so for school I have to make a recursive word ladder program, and I wanna put a binary sea...
[17 replies] Last: OK. We have a winner! Obviously that's what I meant to say when I said... (by seeplus)
Is this an address?
 
int main() { int *ptr; std::cout << ptr << std::endl; return 0; } I kn...
[3 replies] Last: Technically it's undefined behaviour. [quote=jonnin]now your program ... (by Peter87)
Pointer Practice
 
Hi, I am currently experimenting with pointers and classes. Everytime my pointer reach 80% of its s...
[3 replies] Last: There's also an error on L72... Also the code can be somewhat simplif... (by seeplus)
by Geckoo
input parser
 
// here we can write directly our algorithm so as to generate a track inline char algorithm(int t)...
[11 replies] Last: For a simplified getNum(), consider: template <typename T> requires... (by seeplus)
print every second leaf node from right to left
 
let me say that I have tree and the tree has these leaf nodes from right to left: [ 9, 4, 6,16 ,8,1...
[2 replies] Last: Maybe something like (not tried): void writeEveryOtherLeafNode(Node... (by seeplus)
char* mystery output
 
for first b->readData() i get Enter Student name: Enter Student surname: Enter Student ID: but...
[10 replies] Last: where Enter Student name: Enter Student surname: are together when us... (by seeplus)
Valid Access
 
This is the code we were given and the question is , Is line 18 (return x;) a valid access and justi...
[12 replies] Last: @anonomyss: Can you now answer the questions below? class A { int... (by keskiverto)
They overloaded a struct constructor?
 
I was checking out the "Flare Game Engine" source code for fun, and I came across this: [line 6] c...
[4 replies] Last: Thank you guys, I've already got a couple of situations that I could u... (by newbieg)
#if 1 statements #else other statements
 
In the following preprocessor code what is the use of statements and other statements? When will the...
[7 replies] Last: Thank you all for the excellent information. Best regards, (by AlexCantor)
Questions about pointer address
 
Consider the code below: int nbr = 3, *ptr = &nbr; std::cout << ptr << std::endl; int *ptr2 = nu...
[9 replies] Last: std::format can print out pointer addresses, it has a format presentat... (by deleted account xyzzy)
Weird output!
 
Consider the code below: int nbr = 7; string str = "Hello world"; cout << str << ' : ' << nb...
[12 replies] Last: Thank you everyone) (by ninja01)
Help with code
 
I need to change the count() so that it counts down till 0 but it should still remain a recursive fu...
[6 replies] Last: #include <iostream> void count(int counter) { if (counter >= 0) { ... (by seeplus)
printing a user input in Queues
 
How can we print user input variables including their ID, Name, and Pages of their document in Queue...
[2 replies] Last: thank you so much man :) (by cplus2303)
Override Class member array variable values
 
When I have an array as a class member variable and I want to override the default values by calling...
[10 replies] Last: Yes, it's global. But that's fine as it's a global constant. constexp... (by seeplus)
September 2022 Pages: 1234
  Archived months: [aug2022] [oct2022]

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