Ich habe Probleme mit der Zuweisung eines Werts an cv
. Basierend auf meinen Code unten, ich bin immer error: invalid initializer
an der Linie:Ungültiger Initialisierer - Array von Strukturen
ChVec cv = r->cv;
Würde jemand wissen, was das Problem sein könnte?
Danke für Ihre Hilfe.
tuple.c
#include "defs.h"
#include "tuple.h"
#include "reln.h"
#include "hash.h"
#include "chvec.h"
#include "bits.h"
Bits tupleHash(Reln r, Tuple t)
{
ChVec cv = r->cv;
...
...
}
chvec.h
#include "defs.h"
#include "reln.h"
#define MAXCHVEC 32
typedef struct {
Byte att;
Byte bit;
} ChVecItem;
typedef ChVecItem ChVec[MAXCHVEC];
reln.h
#ifndef RELN_H
#define RELN_H 1
typedef struct RelnRep *Reln;
#include "defs.h"
#include "tuple.h"
#include "chvec.h"
#include "page.h"
struct RelnRep {
Count nattrs; // number of attributes
Count depth; // depth of main data file
Offset sp; // split pointer
Count npages; // number of main data pages
Count ntups; // total number of tuples
ChVec cv; // choice vector
char mode; // open for read/write
FILE *info; // handle on info file
FILE *data; // handle on data file
FILE *ovflow; // handle on ovflow file
};
Bitte senden Sie uns eine [Minimal, vollständig und prüfbare Beispiel] (http://stackoverflow.com/help/mcve). –
- Der Link wird Ihnen helfen. http://stackoverflow.com/questions/3635053/how-to-copy-array-of-struct-in-c – techEmbedded