Questions tagged as 'classes'

2
answers

php mysqli last record

I have a page that connects through the mysqli class as follows: # include da classe class connectionClass extends mysqli{ public $host="localhost",$dbname="banco",$dbpass="",$dbuser="susus"; public $con; public function __constr...
asked by 23.11.2017 / 20:58
1
answer

Get click element (this) in method

I am refactoring a SPA using MVC with classes and etc ... I made a method that is called when I click on a <i> element and would like to get that element to later delete a relative of it (a <tr> two levels above)....
asked by 01.11.2017 / 12:39
1
answer

Call any function of another class of the same type

I need to pass as parameter to a member function another member function (but from another class). I can do this for functions of the same class, but of another I still can not #include <iostream> using namespace std; void MyP(int a)...
asked by 16.09.2017 / 14:42
2
answers

When should I create a class? [closed]

I know it sounds like a pretty silly question, but I'm starting now in the programming world (focused on mobile). When I create an app it gets all the functions within the Activities, so I never know when I should take methods and attributes...
asked by 11.10.2016 / 23:25
2
answers

Class accessible in every application C # [closed]

I would like a class that is not static to be available to the entire application. At first I thought of making this class static, but for obscure reasons that is not the case, I can not make it static. Then I researched something and found s...
asked by 17.01.2017 / 20:01
1
answer

How to overload the assignment operator in a class containing vector?

I would like to overload the assignment operator ( operator= ), I know I have to reserve memory, and copy data from one to the other, however I do not know how to copy one vector to the other without knowing the size of it . class Pe...
asked by 26.12.2016 / 21:40
1
answer

Class c ++ has no member named

I'm starting to develop a list of lists to represent a graph in memory. I just did this first part and am getting the following error: class std::vector<No> has no member named 'getId' Follow my code so far ... main.cpp: #incl...
asked by 29.04.2016 / 19:51
1
answer

Template class, include header and footer

Hello, I had posted here for some time about my template class, but I decided to modify it, because every time I want to edit a menu, for example, I have to edit all my files. This is my class class Template { private $_template;...
asked by 10.03.2016 / 20:13
1
answer

Undefined reference in C ++

I'm studying c ++ and found a problem when working with object orientation, I followed some tutorials but it did not work. Account.h #ifndef CONTA_H #define CONTA_H #include <string> using namespace std; class Conta{ private...
asked by 17.02.2016 / 17:46
1
answer

When instantiating and when not instantiating the object? [duplicate]

I've learned a lesson from PHP that you can use a class in two ways, without instantiating instantiating the object . // Forma 1 echo SEO_URL::Strip('Caçador mata leão na selva'); // Forma 2 $url = new SEO_URL(); $url->Strip('Ca...
asked by 01.11.2015 / 15:14