» Home » member » Page 1
“Member modifier 'static' must precede the member type and name” Error C#
by Ben Kohn in 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];
Organizing member join dates/member growth data into graphable chunks
by Brazen in 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

C++: How can a public static member function access private instance member variables?
by Puffnstuff in 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

error C2614: 'ChildClass' : illegal member initialization: 'var1' is not a base or member
by wcf in 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
int var1;
class Child : public Base
int chld;
Child() :

Member function that doesn't access member data, and encapsulation, coupling and cohesion
by Seba in 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?

class Data
int value_;
Data(int value) : value_(value) {}
int compute(int coef)
How to forward an argument to a template member function to a member base class pointer in C++
by kalfa in 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
template <class T> void onMsg(T* msg);
IFoxMod* foxMo

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

Here size of object d is 8 by

Class member container iterators not compatible in member function std::find, but why not?
by Icecold in 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
x_["0"] = "0";
x_["1"] = "1";
y_[0] = x_.find("0");
y_[1] = x_.find("1");

Error accessing structure member inside using member function of class
by Bas in 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

Is it standard C++ to assign a member pointer to the address of another member in the constructor initializer?
by Ir0nh1de in C & C++ & C#

Does this conform to the standard?

class Foo {
Bar m_bar;
Bar * m_woo;
Foo() : m_bar(42, 123), m_woo(&m_bar) { }

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .