Questions tagged [member]
A member is an element of an object in the object-oriented programming paradigm.
1,881
questions
-4
votes
0
answers
44
views
How to define a constructor for a class with pointer members? [closed]
class cls {
vector<int*> arr;
};
How should I define his constructor?
0
votes
2
answers
46
views
Classes and inaccessible members
I am having a hard time understanding how to fix this code I get the error message that both point Point::x & Point::y are inaccessible. How do I fix this?
class Point {
int x, y;
public:
...
0
votes
0
answers
20
views
Sending emails to Queue members in salesforce on task object
Currently, I want Queue members to get mail based on the task type which is created.
Task_type__c is the Picklist field on the Task object. I have 8 values in that Picklist field. i.e 8 Task type. ...
0
votes
0
answers
15
views
Calling the member function of an object in another object which is a member of the original object [duplicate]
Okay, I know this is very confusing to type out. Let me clarify that I feel like this should work. I'll provide a simple example and the error (generalized to the example) that I receive.
class A:
...
-1
votes
1
answer
60
views
Why am I getting a nil value from a Ruby object's member, when it is not nil? [closed]
I want to get the value of a field (ScenarioID) in a Ruby ActivityChart object (chart). Displaying the whole chart shows the value I want: 160.
The problem was chart.Scenario yielded the nil value. ...
0
votes
0
answers
20
views
MSAL Exchange Roles Group
I am trying to retrieve the "Members)" information from Exchange "Role assignments" (eg. Compliance Management, Discovery Management, ExchangeServiceAdmins_xx, etc) using the ...
0
votes
0
answers
10
views
Assignment of member std:array in subclass
I have a class that inherits from a base class and has a member of the type standard array. I don't know the correct way to assign a value in the constructor. The following code gives me the error ...
0
votes
1
answer
18
views
SilverStripe unable to populate multiple member Childs
I have 3 type of users
salesman => has many buyers
buyer => has many agents
agent has none child
so I want to list all the buyers associate with that salesman when viewing salesman
and all the ...
-1
votes
0
answers
18
views
Why is my List<Member> not working in Discord JDA?
I'm trying to make a simple discord bot with some commands. I wanted to make a command that lists all the discord members inside of an embedded message. However, I can't get members inside of the List....
0
votes
0
answers
21
views
Trouble understanding member functions [duplicate]
I need to debug this program for class and I am getting two errors when trying to output myPointPtr.x and myPointPtr.y. The error message is, E0153 expression must have class type but it has type &...
3
votes
1
answer
36
views
How to show that there's exactly one element in multiple member collections that meets given criteria in UML?
I have a UML diagram where a football team consists of field players (10 or more) and goalkeepers(1, 2, or 3). How can I show using UML that in a team one of the players is the skipper?
0
votes
0
answers
38
views
Invalid use of non-static data member 'Suduko::N'
class Suduko
{
public:
int N=4;
int grid[N][]={{1,0,3,0}
,{0,0,2,1}
,{0,1,0,2}
,{2,4,0,0}};
bool solve()
{
int i,j;
for(int i=0;i<N;i++)
...
0
votes
2
answers
59
views
How to grant friend class access to value of modified member
What is the proper method to grant class access to modified value of private member of different class.
Using Friend Class is granting me access to value of private member if provided but won't let me ...
1
vote
2
answers
62
views
Find smallest list under conditions
In SWI-Prolog I want to establish the list L from two lists L1 and L2 with the smallest count of elements under the condition, that 1 ∈ L1 and 1 ∈ L2.
If 1 ∉ L1 and 1 ∈ L2, then L = L1. If 1 ∈ L1 and ...
2
votes
1
answer
72
views
Initialization of a base class reference from a derived class member
I have two classes, Base and Derived. Derived constructs Base using its own member object, which inherits from Base::BaseChild.
struct Base
{
struct BaseChild
{
int x = 5;
};
...
0
votes
1
answer
58
views
Use of non-static member function for this Arduino library
In an Arduino project (C++) I use the LiquidMenu library and I have difficulties to integrate this class in my own. The example provided are too simple for a real scenario.
Some code that does not ...
0
votes
1
answer
33
views
Can I expand the set of fields returned by the Google group members API?
I need to make a Google API call to get specific information about members of a group.
The API for fetching group members is described here: https://developers.google.com/admin-sdk/directory/v1/...
-1
votes
2
answers
51
views
Is it possible to get the list of all members from a discord guild using non-bot token?
Since discord developers added intents system I'm unable to get all members from guild using token of my own account. Is it possible now?
0
votes
1
answer
38
views
Reflection loop propertes inside a class
I can't find a solution to my problem, so I try ask here. I have a class and I want to have a method in the class to test for the state of the Properties. The method should return true if any of the ...
0
votes
0
answers
27
views
Save CMS item to profile using webflow and memberstack
I am trying to figure out a way to save a webflow CMS item to my personal profile and let other users do the same via memberstack. Is this doable?
Here is an example of adding a CMS item “bookmark” ...
0
votes
0
answers
14
views
pyrogram - add multiple channel got error
I want to add multiple channel for subscribed
this my code:
def subscribed(filter, client, update):
user_id = update.from_user.id
try:
FORCE_SUB_CHANNEL=[]
for x in os.environ....
0
votes
2
answers
54
views
Best way to essentially make an overridden constant variable?
I want to make something functionally similar to this:
class Base
{
public:
const int ClassID = 1;
}
class Derived1 : public Base
{
public:
const ...
1
vote
0
answers
55
views
How can I kick all Discord members without a role?
I've setup a custom bot in Discord with presence and members, added it the server with admin permissions. These are the codes I tried running, but with no avail:
import discord
from discord.ext import ...
0
votes
0
answers
20
views
What is the right way of accessing attributes/methods from another function or class?
I'm really confused on, what is the "right way" of accessing an attribute/ method of an instance, from somewhere "external", like a function, or from another class
import tkinter ...
0
votes
2
answers
53
views
Pointer to base virtual function vs direct call of base virtual function
Why do these two behave differently?
(obj.*lpfn)();
vs
obj.Base::fn();
I know when we directly call virtual member function (obj.fn()) it will do a virtual dispatch(find correct 'fn' implementation ...
0
votes
0
answers
10
views
Selecting member of a struct vector with variables c++
I have the following situation
struct EW{
int date=0;
float aaa=0;
float bbb=0;
float ccc=0;
float ddd=0;
float eee=0.0;};
Then I have
vector <EW> ew;
string a={};
float sum=0.0;
cin<<a;
...
0
votes
1
answer
31
views
What happens to members of a stack-allocated class put down with placement new on scope end?
I have this (compiling) code:
#include <iostream>
#include <vector>
class Base {
std::vector<Base*> handles_;
public:
Base(Base* handle) : handles_( {handle} ) { };
};
...
0
votes
1
answer
30
views
Finding an object with equal member values
So I have a Card class with _suit and _rank members:
class Card {
private:
char _suit;
int _rank;
public:
Card(char, int); //Constructor
char suit() const; //Returns the ...
1
vote
0
answers
21
views
C99 struct member initialization, containing UNION
I'd like to declare the array of below structure,
typedef struct {
std::string key;
union {
bool b;
int i;
double d;
std::string s;
} val;
} ttt;
and ...
3
votes
2
answers
50
views
Python name mangling allows access both ways
So I have come across a very interesting behavior of python name mangling.
Consider the following code
class C:
def __init__(self):
self.__c = 1
@staticmethod
def change(...
0
votes
2
answers
36
views
Invalid member declaration in Kotlin
I'm new to OOP and Kotlin. For some reason on line 12 of my code, "println(mapOfArithmetic)", I am being given the error that it needs a member declaration. Please help me explain what ...
0
votes
1
answer
57
views
Prolog: Check if dictionary has special member
Based on my question here I have following prolog code:
:-op(900, xfy, →).
:-op(900, xfy, ⟷).
find_axioms(Specific, BaseSet, Fullfill) :-
findall(X,
( member(X, Specific),...
0
votes
1
answer
82
views
Restricting Member permissions on azure active directory
We have developed a webapp and configured its authentication to use our Azure Active Directory tenant. This works fine. We have clients which are other organizations and when a user from one of ...
0
votes
1
answer
50
views
How to hold values used to calculations in c++ template class?
Hello I have doubt about keeping values used to calculation in c++ template class.
The scenario is following, we have a plenty of functions which are using some nested calculations in their ...
4
votes
1
answer
112
views
How to determine the offset of an element of a tuple at compile time?
I need to determine the offset of a certain indexed element of a tuple at compile time.
I tried this function, copied from https://stackoverflow.com/a/55071840/225186 (near the end),
template <std::...
1
vote
1
answer
36
views
How to update my member count through a specific channel name (NOT ID) python
I have tried looping in my bot. The loop is suppose to update the member counter. I wanted double check to see if this is correct as it doesn't update the stats. The channel itself can be made trough ...
0
votes
1
answer
93
views
Is there a SFINAE-template to check if a class has no functions of any kind?
I want to check if a given class has only the following:
Non-static data members
Constructor(s) (default or user-defined)
Destructor (default or user-defined)
This type would be (at least visually ...
0
votes
1
answer
103
views
discord.js Warn bot, members undefined
So im making a bot for discord, its a warn bot, my whole code is wright, but there is an error that i dont understand
this my code:
module.exports.run = async (client, message, args) => {
...
0
votes
1
answer
78
views
Why does ordering of class members of the user defined type matter in C++?
Case 1:
class A
{
B b; //error: identifier B is undefined
struct B
{
};
};
Case 2: Using forward declaration.
class A
{
struct B;
B b; //error: incomplete type is ...
2
votes
0
answers
29
views
MDX Query using generate function and calculated members
I've been trying to solve this query for a while but I don't understand where I'm wrong.
The questions of the query is this one:
Show the winners having a total winner rank points greater than the ...
0
votes
1
answer
36
views
Welcome message in a specific channel when a user joins the server. (guildMemberAdd, discord.js)
How do I make it so that my bot sends a message in a specific channel when a user joins?
When I do this, it logs nothing: (Also here are my bot settings)
const Discord = require("discord.js")...
1
vote
1
answer
29
views
Get all getters results as class variables without specific invoking
Is there a way I can get all the getters results on the instance without specific invoking?
I want to get all class getters as simple members on the class by looping on the class member.
I have a ...
1
vote
1
answer
50
views
Convert Object Based Lambda to Function Pointer
say I have this program situation overhere:
struct A
{
int(*func_ptr)();
};
struct B
{
int b = 0;
void SetFunctionPointerToLambda(A& a)
{
a.func_ptr = [=] () { return b; };...
0
votes
2
answers
63
views
In Twilio Programmable Chat, in Laravel backend, how to get members of a channel, given the channel code
How can I get the list of Twilio members of a channel, on my Laravel backend? I am using Programmable Chat API of Twilio. I tried using ChannelInstance members method or property, but I am not getting ...
0
votes
1
answer
161
views
How to get Discord Member Online Status in Python without bot?
So I want to print my friend's online status in python but without bot, the code looks like this:
from discord import (what should I import?)
from time import sleep
isFriendOnline = "False"
...
0
votes
1
answer
89
views
C++: Variables change values after initialization of different class
I have the following problem.
PerspectiveCamera pcam2(Point(0, 0, 0), Vector(0.5f, 0.5f, 0.3f), Vector(0, 0, 1), pi * 0.9f, pi * 0.9f);
Renderer r12(&pcam2,0);
In the above code, pcam2 is ...
0
votes
2
answers
60
views
C++: Variable that is passed by const referance changes value
for an assignment I was provided with a framework of different classes that use parameters passed by const reference. When I initialize one instance of this same class and then a second one later, the ...
0
votes
1
answer
46
views
Clips not printing anything
I tried to write the following code in CLIPS for a school project (even though I don't understand why AI is done in this language):
(deftemplate blood
(slot bt)
(multislot acc))
(deffacts ...
0
votes
0
answers
17
views
Analysis Services - Dimension Hierarchy - Unbalanced Data - Unknown-Drill-Down-Problem
I am using Microsoft Analysis Services Multidimensional for building a semantic layer as the back-end and in parallel I am using PowerBI as the front-end tool.
Lately I designed a new dimension having ...
0
votes
0
answers
32
views
automatic data return of class members with subscript operator
I have a struct with the name config. Members of the config structure are of type property. Is Property class:
template<class T>
class Property{
public:
Property(function<void(string)> ...