Home > Back-end >  Structures for help ah, self-study, don't know why always compile error, can't use
Structures for help ah, self-study, don't know why always compile error, can't use

Time:09-27

#include
#include
# define INIT_SIZE 100;
# define STACKSIZE 100;
Typedef char SElemType;
Typedef char Status;
Typedef struct {
SElemType * base;
SElemType * top;
Int stacksize;
} SqStack;
The Status InitStack (SqStack & amp; S) {
S.b ase=(SElemType *) malloc (INIT_SIZE * sizeof (SElemType));
S.t op=S.b ase;
S.s tacksize=INIT_SIZE;
return OK;
}
The Status of Push (Sqstack & amp; S, SElemType e) {
If (S.t op - S.b ase>=S.s tacksize) {
S.b ase=(SElemtype *) realloc (S.b ase, (S.s tacksize + STACKSIZE) * sizeof (SElemtype));
S.t op=S.b ase + S.s tacksize;
S.s tacksize +=STACKSIZE;
}

S.t op++=e;
return OK;
}
The Status of Pop (SqStack & amp; S, SElemType {
If (S.t op==S.b ase) return the error;
E=* - S.t op;
return OK;
}
Int main () {

Char date [100].
The scanf (" % s ", date);
Size_t len.
Len=strlen (date);
Printf (" Length: % d \ n ", len);
return 0;
}
Compile a single file...
-- -- -- -- -- -- -- --
- the name of the file: D: \ FFOutput \ assignment 3 c
- the compiler: TDM - GCC 4.9.2 64 - bit Release

With C source file...
-- -- -- -- -- -- -- --
- the C compiler: D: \ FFOutput \ Dev - Cpp \ MinGW64 \ bin \ GCC exe
- command: GCC. Exe "c" D: \ FFOutput \ homework 3. -o "D: \ FFOutput \ homework 3. Exe" - g3 - I "D: \ FFOutput \ Dev - Cpp \ MinGW64 \ include" -i "D: \ FFOutput \ Dev - Cpp \ MinGW64 \ x86_64 - w64 - mingw32 \ include" -i "D: \ FFOutput \ Dev - Cpp \ MinGW64 \ lib \ GCC \ x86_64 w64 - mingw32\4.9.2 \ include" -l "D: \ FFOutput \ Dev - Cpp \ MinGW64 \ lib" -l "D: \ FFOutput \ Dev - Cpp \ MinGW64 \ x86_64 - w64 - mingw32 \ lib" - static - libgcc - g3
D: \ FFOutput \ homework 3. C: In the function 'main' :

D: \ FFOutput \ homework 3. C: 8:18: error: 'STR' undeclared (first use in this function)
Len=strlen (STR);
^
D: \ FFOutput \ homework 3. C: 8:18: note: each undeclared identifier is reported only once for each function it appears in the


Compile the results...
-- -- -- -- -- -- -- --
- error: 1
- warning: 0
- output filename: D: \ FFOutput \ homework 3. Exe
- the output size: 148.337890625 KiB
- the compile time: 0.13 s