Beginners - July 2021 (Page 3)

by Hyung
Get a value from a data
My sibling ask me to find error in his coding. He want to find smallest value he get highest instead. i already try figure out. i spend 2 hour try changing his ...
Jul 21, 2021 at 1:20pm
[8 replies] Last: but what does numeric limit do ? In the code above, it returns the ... (by seeplus)
Domino max number of tiles
An integer N is given, followed by N number of pairs of integers - the pairs represent domino tiles. Each tile can rotate (ie the first number becomes the secon...
Jul 21, 2021 at 1:12pm
[5 replies] Last: So, like I said in my first post ... set up a container of target domi... (by lastchance)
How to find the year for highest value ?
I have a file that consist of 30 rows and 3 column. I have to find the highest value of the second column with the year. for example the file is like : 2012 ...
Jul 21, 2021 at 9:28am
[11 replies] Last: for ( int year; fromFile >> year; ) { // use year } No... (by keskiverto)
How do I continue with this question
Write a function that reads all lines of the input, and print the number of lines that are exactly equal to the first line (including the first line itself). ...
Jul 21, 2021 at 8:48am
[2 replies] Last: #include <iostream> #include <string> int main() { std::string fir... (by seeplus)
Creating a nested for loop clipping function
My old code reads a spritesheet (rows = different buttons, cols = different button states) one row at a time using for loops and divides them into individual sp...
Jul 21, 2021 at 1:17am
[1 reply] : its not the same code... there is nothing at all like the line 14 for ... (by jonnin)
Code loops when you try to print the entire queue
Hello all, I built a program around the concept of queues, while it compiles and allows input and removal of a member, printing ( selection e) causes the pr...
Jul 20, 2021 at 7:43pm
[6 replies] Last: Thank you so much, I understand now. (by jamiprogrammer)
by Hyung
How to fix this coding ?
i have a coding that need to read from a file. i have to find the sum of 2 column from the file. the file is like this : Mon 12 5 50 Tue 20 8 13 Wed 20 2...
Jul 20, 2021 at 2:38pm
[4 replies] Last: that is an initialization, not a subtraction. its set == to -1 this ... (by jonnin)
by mnm71
How can I improve this code?
I wrote this code but how can I improve it without using at least two while auto _Length = DataBlockCount * DataBlockLength; vector<double> totalPacket; ...
Jul 20, 2021 at 3:36am
[6 replies] Last: > auto _L ength = DataBlockCount * DataBlockLength; Avoid using id... (by JLBorges)
by Dufeng
The size of pointers in 64 system
According to cpp reference, a pointer in 64 system is 8 bytes = 64 bits = 2 ^ 64 (https://en.cppreference.com/w/cpp/language/types). However, the address in th...
Jul 20, 2021 at 1:58am
[10 replies] Last: > The original ideal behind C++'s allocator was to encapsulate these d... (by JLBorges)
by Dufeng
For loop behave differenly each time
I am learning c++ and try to understand the object lifetime of the move constructor and copy constructor. I am using g++ 9.2.0, c++17 in vscode. I created a str...
Jul 20, 2021 at 1:56am
[7 replies] Last: The point of @seeplus's post (I think) is that neither your copy or mo... (by mbozzi)
adding and removing structs from a data structure
I'm trying to find a data structure to which structs can be added or removed based on user input of the struct name. I thought I had found something promising i...
Jul 20, 2021 at 1:48am
[1 reply] : > Is there a way to remove an element from the middle of a vector Loc... (by JLBorges)
Missing class template error
For this code I have to use an adjacency matrix to represent the graph. I'm having trouble in my driver.cpp file calling on the graph.h file because it says cla...
Jul 19, 2021 at 3:08pm
[6 replies] Last: Never mind figured it out. (by Lacy9265)
operator overloading, no acces to private members?
Hallo, I am currently learning C++. But now I wrote some code to overload operatos. The first operator- is not working and returns "No access to private membe...
Jul 19, 2021 at 9:28am
[2 replies] Last: Thanks, helped me out alot 😊 (by maffinpower)
make 3d array from another data structure
I have old C/C++ code. Here is fragment unsigned char * data; unsigned long data_size; ... data_size = x * y * channels; data = (unsigned char *)mallo...
Jul 19, 2021 at 6:52am
[8 replies] Last: Easier in Fortran: Wow! Fortran has sure changed massively since I ... (by seeplus)
Trying to use command pattern breaks my code
I'm trying to make a small game engine in SDL2 based around enum switch state machines because they make things easier to organize, interpret, and less messy. A...
Jul 18, 2021 at 11:30pm
[3 replies] Last: I think I got the gist except for how struct user_input actually work... (by mbozzi)
by saam
undeclared identifier 'File
I have got this error Use of undeclared identifier 'File'. How do i fix it ? thanks void DeckGUI::filesDropped(const juce::StringArray &files, int x, int ...
Jul 18, 2021 at 8:28pm
[2 replies] Last: yes thanks@heios. now, Build Succeeded but I cant dragged the file int... (by saam)
Problem with invisible textures
I am having an issue with SDL2 where I want to see and use two different button textures at different times in different places using enum states. Each button i...
Jul 18, 2021 at 12:09am
[5 replies] Last: Thank you. So, I should nest the input, or functions that call up the ... (by jhbardwell)
by nodesc
2D Array Can't Pass As Parameter
Hi, all This program is meant to create a 2d array from user input and then proceed to display this array but with the number of elements swapped with each o...
Jul 17, 2021 at 5:01pm
[3 replies] Last: Perhaps: #include <iostream> #include <limits> #include <string> #i... (by seeplus)
c++ searching from a text file ,when I terminate and run the program again it says no id found
when I search from a text file my program finds the record in c++, but once I terminate it and run it again it does not find the record, it says no id found,I a...
Jul 17, 2021 at 1:16pm
[6 replies] Last: As a first refactor, consider. This first reads the file (if present),... (by seeplus)
new wannabe dev
So, I think my problem is I got too much information available, and need something of a funneling point to start at. At the moment, I'm only interested in makin...
Jul 17, 2021 at 12:32pm
[5 replies] Last: Another game-engine: https://github.com/OneLoneCoder/olcPixelGameEngin... (by thmm)
July 2021 Pages: 12345... 7
  Archived months: [jun2021] [aug2021]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.