Questions tagged [member]

A member is an element of an object in the object-oriented programming paradigm.

A member is an element of an object in the object-oriented programming paradigm. Member variables are often called fields, while member functions are also called methods.

1754 questions
0
votes
1 answer

asp.net Entity Framework 6.0 - What Context Generator should I be using?

Reworded the question: I need to upgrade to the 6.0 Entity Framework. I used the EF 6.x Entity Object Generator to create a new Context. Now, I get a syntax error. It seems that the generated code now generates an ObjectContext rather than the…
Stoertz
  • 7
  • 6
0
votes
0 answers

My PDO class returns Error on Execution

I finished transitioning to PDO and am modifying my system according to fatal errors that pop up. ERR: Call to a member function execute() on a non-object in /home/a1933806/public_html/globals/server-bin/php/core.php LINE: 43 This is my setup with…
0
votes
2 answers

Members of interface's methods have different types

I have this interface public interface TestInterface { [returntype] MethodHere(); } public class test1 : TestInterface { string MethodHere(){ return "Bla"; } } public class test2 : TestInterface { int MethodHere(){ return…
Timo Willemsen
  • 8,717
  • 9
  • 51
  • 82
0
votes
0 answers

Member variables, get and set methods, public and private (Java)

Can the get and set methods be used on any variables? I know it has to do with data encapsulation, but it doesn't really 'click' for me. What's the advantage gained by using them? Take the following code for example: public class Bicycle { private…
Aaron Ausmus
  • 53
  • 1
  • 1
  • 6
0
votes
1 answer

C++ list: copying a local list in a member list

in a method, I have a local variabile std::list ora; and a member variable of same type std::list orb; In my method I have for (std::list::iterator it = ora.begin(); it != ora.end(); ++it) …
volperossa
  • 1,339
  • 20
  • 33
0
votes
2 answers

Initialize member vector in constructor C++

I have a class that has a member with type vector. I want to initialize this member in the constructor call, how can achieve it? I made it like this: .h class A{ public: A(vector *p); private: …
Ferenc Dajka
  • 1,052
  • 3
  • 17
  • 45
0
votes
4 answers

method to subtract from an integer member variable not working as expected

In my class I have set the member variable honey as follows: int honey = 10; What I want the following method to do is take as a parameter the amount of hooney required and either return that amount if it is available and remove the specified…
user2973447
  • 339
  • 1
  • 3
  • 13
0
votes
2 answers

C++ passing vector to template member

I'm sitting on this for quite some time now. I just can't find an answer so it would be cool if you guys could help. There are two classes involved, one (XMLParser) is reading from a ifstream and is deserializing objects and stores them in a local…
Martin
  • 65
  • 8
0
votes
3 answers

Undeclare structure member used in function?

My function definition won't compile because of a supposedly "undeclared" structure member. It says "error: ‘gen’ undeclared". But I declare it and even initialize it afterwards (I left that part out for simplicity). Can you see why this wont…
Emory King
  • 23
  • 4
0
votes
1 answer

Static object member initialization with parameters in class

I have not found right answer though i tried multiple search in this site. I raise the question again. Normally, the static object member should be initialized in the source file. //header file class A{ private: static B* bPoint ; public: …
shijie xu
  • 1,975
  • 21
  • 52
0
votes
3 answers

What is the proper way to call default constructors?

Lately I have been having difficulties with constructors, and the different attempts from other questions and guides always have some form of segfault waiting for me at runtime (making compiling 80% of my time spent programming). The following…
Molma
  • 171
  • 9
0
votes
3 answers

Thread safety of a member function pointer

A class t_analyser contains a function which performs some operations on a t_data object and outputs the results. I would like to add to t_analyser a filter capability: a small and fast function bool filter(const t_data & d) {...} which allows to…
DarioP
  • 5,377
  • 1
  • 33
  • 52
0
votes
2 answers

Display the name and phone # in two different text box

Here is my code so far, I have a list box which shows the name read from a text file. Then I have two text box: txtName and txtPhone. When the name is highlighted in the list box, it should show the name in the txtName and the phone nunber in the…
user2844903
  • 1
  • 1
  • 1
0
votes
2 answers

error: request for member ‘update’ in ‘ofEvents’, which is of non-class type ‘ofCoreEvents&()’|

I have a C++ code written using OpenFrameWorks 007 pre-release and I'm modifying it to match OpenFrameWorks 008. The line - 1. ofAddListener(ofEvents.update, this, &ofxAutoControlPanel::update); gives the error - …
0
votes
1 answer

abstract member functions fail to access atributes of inheriting class

in php I have this code. I'm trying to get an inherited method to utilize a member variable of its child class. abstract class HtmlObj{ //abstract protected function jQuery_Activity(); public $hyperlink; abstract protected function…
1 2 3
99
100