» Home » member » Page 1
Organizing member join dates/member growth data into graphable chunks
Category : Programming Languages

I'm dabbling with pChart and would like to start with a simple line graph showing the growth in membership over time.


Y-axis would be # of members
X-axis would be time


For each time datapoint, I need a corresponding total members datapoint.


My user table is structured as:
[user_id] [join_date]


The approach I came up with


View Replies


Member function that doesn't access member data, and encapsulation, coupling and cohesion
Category : Programming Languages

A class having a member function which does not operate on the class's data members ( directly or indirectly), is it decreased encapsulation, tighter coupling, or lower cohesion? Why?
EDIT:


class Data
{
private:
int value_;
public:
Data(int value) : value_(value) {}
int compute(int coef)
{
check(coef);
View Replies


C++: How can a public static member function access private instance member variables?
Category : Programming Languages

I'm writing a C++ class to read input from a file into preallocated buffers called "chunks".


I want the caller to be able to call a public static Chunk class method called GetNextFilledChunk(), which


Grabs a Chunk from an inactive chunk pool
Fills the Chunk instance from the input stream using the Chunk's private member variables/functions
Returns a pointer to the

View Replies


error C2614: 'ChildClass' : illegal member initialization: 'var1' is not a base or member
Category : Programming Languages

I am getting the following error in C++:


error C2614: 'ChildClass' : illegal member initialization: 'var1' is
not a base or member


Class Base
{
protected:
int var1;
public:
Base()
{
var1=0;
}
}
class Child : public Base
{
int chld;
public:
Child() :

View Replies


“Member modifier 'static' must precede the member type and name” Error C#
Category : C & C++ & C#

I am building a game of BlackJack and the main class for it is having a problem. This is my code:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public class blackjack
{
static string[] playercards = new string[11];
View Replies


If both base and derive class has a same member variable, how compiler resolve which member is to be called?
Category : Programming Languages
Look at this example
class base {
public:
int m1;
base() {
m1 = 5;
}
};
class der: public base {
public:
int m1;
der() {
m1 = 6;
}
};
int main() {
der d;
cout << d.m1;
return 0;
}

Here size of object d is 8 by


View Replies


How to forward an argument to a template member function to a member base class pointer in C++
Category : C & C++ & C#

I have a class Foo which uses CRTP to inherit a template method from a parent class and avoid having to provide literally dozens of individual member methods. Something like this:


class Foo : public SomeBarClass<Foo>
{
//..
//from SomeBarClass
public:
template <class T> void onMsg(T* msg);
private:
IFoxMod* foxMo

View Replies


Error accessing structure member inside using member function of class
Category : Programming Languages

Error accessing structure member inside using member function of class. Hello i am unable to figure out the runtime error i am getting.
Actually i am trying t declare a struct inside a class then using the main method i m creating a pointer object of the class then using that object i trying to access the member function which tries to initialize the struct variables . but it i not happening


View Replies


Initialise static const, non-integral, class member with a private member
Category : Programming Languages

Im am attempting to initialise a static const non-integral. However it requires parameters which are private. If it was of integral type you could place it in the class body and allow allow one variable to take the value of another ie


static const int A=0;
static const int B=A;

But as its non-integral it must be initialised outside of the class body, but


View Replies


Class member container iterators not compatible in member function std::find, but why not?
Category : Programming Languages

I hit some behaviour I can't seem to wrap my head around. Say I have a class defined as follows (a simple example for illustration):


class some_class
{
public:
some_class()
{
x_["0"] = "0";
x_["1"] = "1";
y_[0] = x_.find("0");
y_[1] = x_.find("1");
}

View Replies


Next
2012 / 2017 Copyrights BigHow , All Rights Reserved .