I am not able to run my own structure program. Because it is receiving the "need for continuous expression" error in this line:
struct book_info book [i];
You are definitely using a compiler (or a compiler mode) Which does not support variable length Erase.
The ability to declare the variable length array (VLA) was added to C99, if your compiler does not meet the standard, or you gcc -std = c89 , this Will not work. For example:
pax $ cat qq.c #include & lt; Stdio.h & gt; #include & lt; String.h & gt; Int main (zero) {int i = 7; Four x [ii]; Strcpy (x, "xyz"); Printf ("% s \ n", x); Return 0; } Packs $ GCC -STD = C-99 -Pinkic -Val-o qq qq.c; ./qq xyz pax $ gcc -std = c89 -pedantic -Wall -o qq qq.c qq.c: "main" in function: qq.c: 5: Warning: prevents ISO C90 variable length arrays รข ?? ?? Xacute
Comments
Post a Comment