Beginners - October 2022

Initialize 2D char array by passing addresses
 
Hello guys, can i am trying to initialize a 2D char array with this code below static char c1, c2, c3, c4; c1 = 'a'; c2 = 'b'; c3 = 'c'; c...
[3 replies] Last: #include <iostream> int main() { static char c1, c2, c3, c4; ... (by againtry)
create iterator to map value?
 
Hi I am designing a class which will have a private member which is of type map<ID, Something>. I would like the user of the class to be able to iterate over...
[8 replies] Last: Right, very nice! I treated it as if I knew nothing (apart from the m... (by jonnin)
Object oriented programming menu troubles
 
Hello all, i am in a programming 2 class and thought i was understanding quite well, but i am getting stuck with this project my professor assigned. I believe i...
[4 replies] Last: L74/75 - subchoice isn't zero based - it's one based. You need to subt... (by seeplus)
confusion on -> operator
 
I am implementing a linked list and I get an error in line 28 "cannot convert ‘node<int>’ to ‘node<int>*’ in assignment". I am confused - next is of typ...
[10 replies] Last: seems to work C++ is one of those languages that just because some ... (by seeplus)
Class Factory
 
A while back I made a class factory by doing the following: class A { }; A * classASpawner() { return new A; } class B : public A { }; A* classBSpawn...
[7 replies] Last: Sorry, took a break from the internet for a bit. The key use that I ... (by newbieg)
Get() taking in newline
 
Hello. I am creating a program to read in a maze and solve it but when I read in the maze file into a dynamically allocated array using get I notice it reads th...
[4 replies] Last: Or even: #include <iostream> #include <fstream> #include <string> #... (by seeplus)
Exractin 3D matrix from 4D
 
Hello everyone, I will be very happy if you can help me. I have 4D matrix , which is called EC and like EX . I want to extract 3D matrix of each p like New...
[2 replies] Last: @mbozzi ,yes, exactly. That's what I want. You helped me :) Thank you ... (by learner999)
General Tree
 
How can I transform my number output into letters by implementing general tree A /\ B C D E F G / \ \ \ /\ ...
[1 reply] : A /\ B C D E F G / \ \ \ /\ ... (by cplus2303)
"for" loop not running program multiple times
 
Write your question here. I need some help on my cpp code and "for" loops, when I try to run it will only run through the program 1 time no matter what I input...
[9 replies] Last: I agree. All what you said is true. However I wanted to be clear in or... (by Geckoo)
Need help writing a password checker.
 
so I have 2 files that have passwords, one is the passwords that Im checking and one is the passwords im checking against, ive done everything up until the poin...
[3 replies] Last: I appreciate the information and advice you have shared. I will try to... (by Ethan69)
get current quantity of rows of dynamic 2d array
 
have 2d array int array_of_ints ; this array will be dynamically filled with data need get current quantity of rows of dynamic 2d array not size of arra...
[8 replies] Last: How can I get the quantity of rows with request? A less efficient app... (by coder777)
About Raw Pointers and Linked Lists
 
Hi again. I'm studying the linked lists in C and C++. Here, I tried to copy C code into C++ code. Because I'm experimenting with different structures. My ...
[4 replies] Last: Peter87, jonnin, seeplus; thanks for your big help. I can't still unde... (by bydrachen)
Random String Selection From Library
 
I would like to use "cout" to display a randomly selected string from a library. For my specific project I would like to randomly generate a first name for a ga...
[17 replies] Last: My adaptation of that working paper's simple toolkit proposal. Header... (by George P)
how to delete the context of 2D matrix
 
Hello everyone, I have two functions. One, Function 1, produces tuple contains one double and one 1D vector. In the second, Function 2, I run the Function 1 f...
[4 replies] Last: You're welcome. Glad I could help! (by MikeyBoy)
Lookup with using namespace
 
Hi, I was wondering why this prints "unqual" and not "qual" since I have "using namespace a" before calling fun. I though that would be equivalant to having a:...
[2 replies] Last: Or perhaps the "nearest enclosing namespace" is really the global name... (by Peter87)
implementing the backpropagation algorithm
 
I have written a basic linear algebra library and a MLP (I started to learn C++ a week ago). Now, when I run the code I get an assertion error - in the backprop...
[2 replies] Last: when I run the code I get an assertion error - in the backprop() met... (by seeplus)
Worked more on my password checker but still need some help
 
So I did some more work on this, and my logic is that each of my passwords I will check against the list of 100 passwords but im having some trouble with the fu...
[11 replies] Last: Based purely on the given code, then: #include <iostream> #include ... (by seeplus)
Need help writing a password checker.
 
so I have 2 files that have passwords, one is the passwords that Im checking and one is the passwords im checking against, ive done everything up until the poin...
[12 replies] Last: [continued here https://cplusplus.com/forum/beginner/284960/ ] (by seeplus)
Renaming a template class to make it more specific
 
Hello I would like to rename a std::array<uint8_t, size_t> as Buffer<size_t> (i.e. the renamed type's element type is always uint8_t) I was thinking of so...
[2 replies] Last: template <size_t N> using buffer = std::array<uint8_t, N>; ... (by mbozzi)
random number
 
why i get the same output when i compile and run the program? #include <iostream> #include <stdlib.h> #include <time.h> using namespace std; ...
[6 replies] Last: Even if the 'divide an int by a double' didn't result in a rather nast... (by George P)
October 2022 Pages: 12
  Archived months: [sep2022] [nov2022]

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