Beginners - February 2020

What's wrong with my code?
 
I was writing a code in c++ using Visual Studio Community 2017 (with Commom Language Runtime Support (/clr) - Windows Desktop | Windows Console Application) and...
[6 replies] Last: I’m so grateful to you for help me with it. Now I feel I am ready to... (by roddiasgold)
by Bopaki
Battling to print out the largest element in the list
 
I get the following warnings: 49. 49 declaration shadows a field of linkedListForward 60. 57 will never be executed 81. 28 variable 'first' is uninitializ...
[3 replies] Last: A question about logic: linkedListForward foo; foo.buildListForward()... (by keskiverto)
by Bopaki
Help me resolve the errors below
 
I get the following warnings: 50 50 declaration shadows a field of linkedListForward 60. 57 will never be executed 82. 28 variable 'first' is uninitiali...
[2 replies] Last: Hello Bopaki, Do not double post. http://www.cplusplus.com/forum/beg... (by Handy Andy)
Cannot Convert GDI Plus Bitmap to Base 64
 
I cannot convert a GDI+ bitmap to base 64. I have so far: 1. Downloaded and included this library: https://github.com/ReneNyffenegger/cpp-base64 2. Written th...
[13 replies] Last: Thank you all for you help, but I solved my own problem. I was confus... (by Manannan)
Polymorphism - what’s allowed..?
 
Ok, so I am in the process of making a doubly-linked list type thing that has some weird stuff going on with the individual nodes. Basically I have my front and...
[12 replies] Last: ... I mean, no, but Idk what you mean. Maybe I’ll look at it. Yeah I... (by highwayman)
Exercise asking to use default copy constructor - for a deep copy
 
Requirement: Given the class CharQueue2 below with a std::deque<char> data member. Use the compiler generated copy constructor and assignment operator as a bitw...
[1 reply] : The distinction between "shallow" and "deep" copies is not particularl... (by mbozzi)
Linked List - no errors but a few warning
 
Hello again, I have been working on this linked list code for the last few hours and at first it read in garbage and all which I'm use to seeing, but now that I...
[16 replies] Last: #include <iostream> #include <iomanip> #include <fstream> using nam... (by CodeNovice01)
Decide what to return on 'deque' operation (Queue)
 
Imagine I was given this task: char CharQueue2::dequeue(){//Write code here to make this work } Then I write the below pop_back() operation. Question is, if ...
[5 replies] Last: Then should you be using std::deque or should you be using something e... (by jlb)
function call problem
 
class assignment. copy and paste the code below including function call. everyone's worked except mine. they were using macs, I am using a surface book. outp...
[12 replies] Last: for anyone coming through with the same problem. Here's the backgroun... (by bigskit13)
Basic Queue exercise: error when assigning size() of a deque
 
Hello, I am working to get the capacity of a Queue data structure as per the class outlined below. I attempted to assign size() to the deque variable, but I am ...
[4 replies] Last: Perfect. resize() does work just fine. THANK YOU !!! (by mrpear2020)
Swap objects in a queue: How to define this data type?
 
I am writing the code below for method 'swap'. Question is, if data type is "CharQueue2", how do I test this? I am doing in main: CharQueue2 q; //Create th...
[3 replies] Last: Apart from that, consider: void CharQueue2::swap( CharQueue2 & src ) ... (by keskiverto)
Help in question
 
Today is Valentine's Day and Kabir and Tara have decided to celebrate it. Now, both of them are going to park to spend some quality time together. The city i...
[10 replies] Last: depends on the sequence(s). if its a linear sequence, for example, yo... (by jonnin)
Very nice question
 
Today is Chocolate day and Kabir and Tara are visiting a Valentine fair. Upon arriving, they find a stall with an interesting game. There are N jars having s...
[2 replies] Last: duplicate thread. the original thread is still waiting on the Op to ... (by jonnin)
by alexas
how to deduct tuples // checking cuboid intersection
 
I have a task to do a coarse check if cuboids intersect by assuming they are spheres. So I have cuboid class with three arrays stored as x, y, z coordinates of ...
[1 reply] : you are making this too hard, maybe? you have 3 distances. object a ... (by jonnin)
Basic Queue operation: enqueue/push_back returning an error
 
Hello, I am writing the "enqueue" method for the class below. I am getting error: main.cpp: In function ‘void enqueue(char)’: main.cpp:21:5: error: ‘va...
[5 replies] Last: Actually, it was a const char *, not a std::string. (by lastchance)
by AJ24
If statements problems
 
I'm having trouble running my code. I'm new to codding and to the language itself. The program is supposed to compute the price of any sign a customer order...
[12 replies] Last: @Manga, Not really. My understanding of the instructions is that the... (by Handy Andy)
by hbcpp
Accessing private variables in friend methods from a class that is inside a namespace
 
Below is the sample code that illustrates my problem. #include <iostream> #include <ostream> using namespace std; namespace test { class Test ...
[5 replies] Last: Noted Andy, thanks guys for the help, really appreciated it. (by hbcpp)
by alexas
Check if cuboids are overlapping as fast as possible (no iteration) in c++
 
I have a cuboid class where cuboid coordinates are provided as set of arrays: Cuboid3D cube_a ({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f}, // x c...
[19 replies] Last: It may be useful to keep a list of all sorted by the distance of each ... (by jonnin)
Passing values
 
How to print the total purchase cost from a cout comand in the main function? My output is: The total purchase price is: $121.663 but i want that to be the outp...
[2 replies] Last: Hello dannyboy89, PLEASE ALWAYS USE CODE TAGS (the <> formatting bu... (by Handy Andy)
storing a char array into a 2D char array
 
Hi, I'm having trouble running my program for storing words into a 2D dictionary array and I ran in to the problem that the error says: invalid conversion from ...
[5 replies] Last: Hello Fredo25, I encountered another error, for my function which lo... (by Handy Andy)
February 2020 Pages: 123... 13
  Archived months: [jan2020] [mar2020]

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