struct

printing a timeval struct

Possible Duplicate: How to access the fields of a timeval structure continue to the link below please about this problem: http://stackoverflow.com/questions/4029923/how-to-access-the-fields-of-a-timeval-structure ...

Defaults constructors, why my class seems to have three? When compilers treats classes like structures?

I always thought, that there are only two defaults construcors: constructor with no arguments, and copy construtor. But today I wrote something like this: First I wanted to make sure that in C++ initialization of structures in c-style is still valid.. struct Foo{ int a; bool b; char* c; double d; }; //.. Foo arr[2]={{0...

Extract a struct member from an array of structs

I have an array of structures that contain multiple variables: struct test_case { const int input1; //... const int output; }; test_case tc[] = { {0, /**/ 1}, // ... {99, /**/ 17} }; int tc_size = sizeof(tc) / sizeof(*tc); and I want to extract a vector of the outputs so I can compare them to another array...

Error: copy assignment operator not allowed in union

I am compiling the code below when the following erro comes up. I am unable to find the reason. typedef union { struct { const int j; } tag; } X; int main(){ return 0; } error: member `<`anonymous union>::`<`anonymous struct> `<`anonymous union>::tag with copy assignment operator not allowed in union This code c...

how to copy from text box to struct C#

I need to copy the strings from text box to struct. is there any way to do it? here's what am trying: public unsafe struct mystruc { public byte[] install_name; // size limit 32 bytes public byte[] install_id; // size limit 4 bytes public byte[] model_name; // size limit 4 bytes }; private void read_b_Click(object sende...

How do I allocate more space for my array of C structs?

I'm trying to add 10 more elements to my struct that has been already malloc with a fixed sized of 20. This is the way I have my struct defined: #include <stdio.h> #include <stdlib.h> #include <string.h> struct st_temp { char *prod; }; int main () { struct st_temp **temp_struct; size_t j; temp_struct = malloc (sizeof *tem...

Basic C++: How do I initialize a struct member of a class?

Hi all. I've looked all over the place, but haven't found an answer to this. I have a C++ class with these protected members: struct tm _creationDate; struct tm _expirationDate; struct tm _lockDate; I want to initialize them at instantiation time. If I put this in the constructor: _creationDate = {0}; _expirationDate = {0}...