Questions tagged [datamember]

204 questions
0
votes
2 answers

Skip DataMember via DataContractSerializer

I have a class: [DataContract] public class Result { [DataMember] public String Log {get; set;} [DataMember] public String Data {get; set;} } I send this class via WCF and it works fine. But I want to save this class to a xml file after…
xtmq
  • 3,380
  • 22
  • 26
-1
votes
1 answer

Is writing data members inside ctor more pythonic?

My limited experience in python shows that class Person: def __init__(self): self.data: Tuple[int, str] = (5, "M") print("DONE") is more common than class Person: data: Tuple[int, str] = (5, "M") def __init__(self): …
OrenIshShalom
  • 5,974
  • 9
  • 37
  • 87
-1
votes
1 answer

Member of nested class isn't being initialized by the constructor

I have two classes, Outer and Inner. Outer contains no data members. Inner contains one data member, inner1_. When I call the constructor for outer, I create an instance of the class Inner, inner1. When the constructor for inner1 is called, its data…
mana
  • 545
  • 4
  • 12
-1
votes
1 answer

What the function's signature means?

#ifndef _RECT #define _RECT #include "Point.h" using namespace std; class Rectangle { private: Point _topLeft; Point _bottomRight; int _color; public: Rectangle( double left, double top, double width, double height, int color…
Sherry Bar
  • 11
  • 2
-1
votes
1 answer

Modifying an object also modifies all other objects of the same class

It's a long time ago since my last c++ project and now I'm stuck in a very simple problem. I create two objects and want to modify only one of them. Now I don't understand why the other object is also modified... MainClass: #include…
DeadCat
  • 29
  • 4
-1
votes
1 answer

Compiler error: method or datamember not found vb6 (Addnew)

Private Sub Command1_Click() Dim contador As Integer Dim tabla As TableDef Dim columna As Field Dim baseDeDatos As Database Dim directorioDB As String Set tabla = baseDeDatos.OpenTable("Empleados") tabla.AddNew tabla!Legajo =…
-1
votes
1 answer

Compile Error: Undeclared member that is actually declared

I have created a class that works as it should except for three supplemental member functions. In all of the other public member functions I refer to a private data member and I have no trouble accessing the data I need; however, with these three…
-3
votes
3 answers

Where is memory allocated for data members in java which has been initialized @ declaration point ...?

In java it is possible to write a code like public class Print{ int n=10; String path="C:\\file.txt"; } Where does the memory for these data members are allocated before object creation ?? And i suppose we can't do the same in C++ !! Explain me…
Dinesh
  • 13
  • 6
-11
votes
2 answers

What does this nested struct declaration mean?

#include using namespace std; struct { struct { struct { char *OwO[12]; }iwi; }uwu; }owo; int main() { *owo.uwu.iwi.OwO = "What's this?"; printf("%s\n", *owo.uwu.iwi.OwO); return 0; } Hi guys I don't know…
1 2 3
13
14