• Register

Recent questions tagged class

0 votes
1 answer 5 views
Problem: I am studying in C ++, and managing its syntax, and I came across this question. What is the difference between defining objects? nameclass nameobject; nameobject.namemethod (); to this other: nameclass * nameobject = new nameclass (); nameobject-> namemethod (); I know ... .). and in the second it is with (->). Why? I appreciate and help me every answer, comment or recommendation. : D
asked 1 day ago sasha 6.4k points
0 votes
1 answer 12 views
Problem: I am a new programmer. I have been learning to program for a while now and recently covered all the basics of programming in C++. Now, my mentor has told me to clear my concepts about object-oriented programming. I have learned many ... difference between both? I want answers to these questions. Could someone from here please explain in simple language that a noob could understand?
asked Jan 17 Code Learner 5.5k points
0 votes
1 answer 18 views
Problem: Hi there! I have been learning to program for a long time now and I recently learned inheritance in Java. I wrote the following program for practice: class Institutions { public void print_institutions() { System.out.println("This is an institution"); } } class ... , I have no idea what is causing this error. Can anybody here please clarify the cause of the error and its solution? Thanks!
asked Dec 29, 2020 Code Learner 5.5k points
0 votes
1 answer 21 views
Problem: Errors: ||=== terrac, Debug ===| C:\terrac\gameObject.cpp|4|error: redefinition of `class gameObject'| C:\terrac\gameObject.h|3|error: previous definition of `class gameObject'| ||=== Build finished: 2 errors, 0 warnings ===| I can't figure out what's wrong. Help?
asked Dec 27, 2020 Mashhoodch 6.6k points
0 votes
1 answer 18 views
Problem Hey, I Am getting an error request for a member which is of non-class typeI don&rsquo;t know how to resolve this error.Can somebody help me resolve it? This will be great for me to make me relax to solve problems. Here&rsquo;s my code Vector.h #ifndef VECTOR_H_INCLUDED ... #include <cassert> #include "Vector.h" using namespace std; int main() {    Vector<int> v;    //v.push_back(8); }
asked Dec 24, 2020 chris jordan 2.2k points
0 votes
1 answer 22 views
Problem Hey, what is dynamic_cast in C++. provide me a relevant solution that can clear everything.
asked Dec 23, 2020 chris jordan 2.2k points
0 votes
1 answer 2 views
Problem Hey, I just want to know what are nested classes?
asked Dec 19, 2020 chris jordan 2.2k points
0 votes
1 answer 17 views
Problem Hey, I need to submit an assignment on the parking ticket simulator system. Please help me by providing me the best one that you can create for me.
asked Dec 2, 2020 chris jordan 2.2k points
0 votes
1 answer 91 views
Problem: I have been working on classes in C++ for about a few days. I am learning constructors with parameters. I was trying to run the following program in which I have declared two constructors, one without parameters and other with one parameter. The problem ... The program works perfectly when I comment out the error-generating statement. I have no idea what I am doing wrong. Please Help.
asked Nov 9, 2020 Code Learner 5.5k points
0 votes
1 answer 36 views
Problem: I am making a program which consists of solving a 2x2 equation, for this I used the Cramer method, the problem is not how to solve it, but it throws an error when executing it, and I suspect that it is because I used methods of the Matrix class Inside the Vector class ... " using namespace std; int main () { cout << "As long as the program compiles well it is enough" << endl; return 0; }
asked Nov 5, 2020 sasha 6.4k points
0 votes
1 answer 22 views
0 votes
1 answer 27 views
0 votes
1 answer 10 views
I have a class to hold the student information. But an error was generated. PHP generated this error: &ldquo;Uncaught Error: Using $this when not in object context&rdquo;. I&rsquo;ve attached my code here. class Students { private $name; private $age; private $level; ... error appears: &ldquo;Non-static method Students::init() should not be called statically&rdquo;. I don&rsquo;t know what to do.
asked Oct 13, 2020 azriel 590 points
0 votes
1 answer 10 views
Problem: Hi there! I have a class named vehicle and now I want to make objects of this class and instantiate them with some value. How can I instantiate an object of a custom class in C++?
asked Oct 13, 2020 Code Learner 5.5k points
0 votes
1 answer 13 views
Hi, I have a small php project. I need a php class that will enable me to retrieve the information from a database so that I can display in a table as shown in this html code: <!DOCTYPE html> <html> <head> <title>List of Cars</title> </head> <body> <table> <tr> <th>Year</th> <th>Brand</ ... >AUDI Q2 2020</td> </tr> <tr> <td>2020</td> <td>Volvo</td> <td>Xc60 2020</td> </tr> </table> </body> </html>
asked Oct 11, 2020 azriel 590 points
0 votes
1 answer 18 views
I created my first php class. I have two methods in this class. One was to initialize the colors and the other was to return the selected color. But my code encounters this error: &ldquo;Invalid argument supplied for foreach()&rdquo;. Please help. class MyColors { private $colors=array(); function __construct( ... , array('id' => 4, 'color' => 'white'), array('id' => 5, 'color' => 'yellow') ); } }
asked Oct 11, 2020 dorothy 300 points
0 votes
1 answer 26 views
0 votes
1 answer 17 views
0 votes
1 answer 22 views
I have created a Person class with two attributes, age and name, and later I have implemented a vector of people to try to print the attributes of the objects entered there. When I try to access the age attribute, there is no problem and it prints the values to me, but when trying to access ... people_vector.begin ();   while (it! = vector_people.end ())   {     it-> getName ();     it ++;   } }
asked Aug 15, 2020 game 4.6k points