Beginners - November 2022

Array
 
Hello, I am a bit lost. I was given to try and do this program but I am not really familiar with arrays so I am in need of big help. At the moment I am trying t...
[5 replies] Last: Thank you all for your help! I think I got the hang of it and actually... (by Krakenvangh)
callback function clarification
 
Hi. I didn't understand the concept and core uses of callback function(Except making the code more concise and readable). i understand that this is a function ...
[3 replies] Last: but why not to simply call A inside B? The point of a callback, is ... (by MikeyBoy)
How to write png file from scratch?
 
Hi, I want to write a.png file from scratch. For example a red 8 x 8 pixel square. Do I need a special library? Thanks for your input.
[15 replies] Last: I turned the above into a complete sample program. This is my first t... (by mbozzi)
Input values in matrix
 
how can I manually input values in the matrix like the given matrix below in the code? #include <iostream> #include <vector> #include <unordered_map> ...
[2 replies] Last: thank you so much sir!! :) (by cplus2303)
by Mobo01
fixed length data types
 
I've read that the size of data types like int might differ between systems. My first question is, can someone provide an example of what goes wrong when a pro...
[8 replies] Last: Of course you chances of running into a Cray are pretty small unless ... (by seeplus)
How would I fix this compiler error
 
Im declaring a "College" object like this College DVC("Diablo Valley College"); And its giving me a compiler error, How would I fix this? #incl...
[6 replies] Last: You could declare the function: College(string collegeName, int initi... (by keskiverto)
What does the "n" argument of std::string::find_first_of(cstr, pos, n) mean?
 
As I understand it, string::find_first_of looks though a string for any character found in cstr in the interval [pos, pos+n) . So in the code below, the ...
[4 replies] Last: [quote=ElusiveTau]I think the documentation and example code on cppref... (by keskiverto)
Initialize union array
 
I keep getting errors on post. I will build the question one section at a time doing edits after adding each section. If you read this, please be patient. Wi...
[9 replies] Last: Its best not as a union. These responses were to this ask: Second: J... (by jonnin)
Reading test data from file
 
Hi, Please help me with this. I have to write a program that reads test data from a file. Scenario: Each test case starts with LOCATE and ends with Output....
[9 replies] Last: #include <iostream> #include <fstream> #include <string> #include <s... (by seeplus)
unresolved external symbol referenced in function.
 
Hello, I'm trying to implement a template in to my code so I can use multiple linked lists, all with different data types. An error has appeared in my source.cp...
[19 replies] Last: #include <iostream> #include <string> template < typename T > struct... (by JLBorges)
Not found in Visual Studio
 
Windows 11, Visual Studio 2019, C++ I am trying to implement code for RIPEMD-160. The best starter I have managed to discover is from project bitcoin-tool-m...
[2 replies] Last: Wow! Did not expect a reply so soon. Did not expect anything like tha... (by bkelly13)
Algorithm Analysis
 
A program that raises a number x to an arbitrary nonnegative integer, n. How can I make a program using this pseudocode that can be used for theoretical, experi...
[1 reply] : #include <iostream> double brpower( double x, unsigned n ) { if (... (by lastchance)
Time Complexity of a Recursive Function with a Reducing Parameter
 
What's the big O notation and how can I calculate it? I'm new to this. Is there a general rule of this? int func (int n, int m) { if (n<1) ...
[2 replies] Last: recursion is just a type of loop, you treat it the same way. The pain... (by jonnin)
32 bit signed integer
 
Hi. I have get_massege function which needs to return 32 bit integer. So i thought about using u32. Then i realized i have some ERROR CODEs which need to ...
[13 replies] Last: Thanks :)) (by Jonathan100)
How on earth are these undefined
 
I literally initialized them in main, and they dont get called until they are initialized so I don't know why I am getting an error, also fyi my program is not ...
[4 replies] Last: To expand on what others have said: lengthUp and lengthDown are de... (by MikeyBoy)
How to structure and document a project to get design help?
 
I haven't designed many programs and I think a logging library would make for a good project: 1. It can start out simple and grow as I need more appenders. ...
[1 reply] : Definitely starting a github page is recommended; to distribute your c... (by newbieg)
Binary Search Tree
 
Read the first line of code as a key Ignore it Read the following as a binary search tree main.cpp Node *tree; Node *root; char str ; int ...
[4 replies] Last: What's the key and what's the data here? The input file appears to ha... (by dhayden)
by Ch1156
How do I get my map to work in my class for my inventory system?
 
So Im just testing out how to use maps for an inventory system and It seems like theres a problem with using a class as an argument, what am i doing wrong? I wr...
[7 replies] Last: Ah ok, its supposed to be standalone, thats what was messing me up, so... (by Ch1156)
Function pointer error
 
I have 2 functions, callFunc is a class member testFunc isn't a class member I can bind a function pointer to testFunc but I cannot do that for callFunc (lin...
[3 replies] Last: Have considered std::function? #include <functional> struct Math {... (by kbw)
Copy data from 2D array to 1D array (5 times bigger)
 
I am trying copy the data from a 2D array with height*width elements, to a 1D array with 5*height*width elements. Right now, I got this code: float * Netp...
[5 replies] Last: Still the same error. What I think is happening it's somehow the varia... (by klebermo)
November 2022 Pages: 12
  Archived months: [oct2022] [dec2022]

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