Try,
struct caketime { double baking_time[4]; double prepare_time[4]; };
instead of,
struct caketime { double baking_time [4]={20,75,40,30}; double prepare_time[4]={30,40,25,60}; };
You should not initialize the array elements inside the structure.
Related Posts:
- How to initialize array to 0 in C?
- How to properly malloc for array of struct in C
- Convert char array to a int number in C
- Returning an array using C
- How to copy a char array in C?
- C subscripted value is neither array nor pointer nor vector when assigning an array element value
- Initializing array of structures
- How to empty a char array?
- What is the difference between array and enum in C ?
- Can I create an Array of Char pointers in C?
- Excess elements of scalar initializer for pointer to array of ints
- Can I define a function inside a C structure?
- Parameter name omitted error?
- How to allocate array of pointers for strings by malloc in C?
- typedef fixed length array
- C: warning: excess elements in array initializer; near initialization for ‘xxx’ ; expects ‘char *’, but has type ‘int’
- Pointer to 2D arrays in C
- Initializing 2D char array in C
- How do I check if a string contains a certain character?
- strdup() – what does it do in C?
- How do I create an array of strings in C?
- “Expected expression before ‘ { ‘ token”
- C pointers and arrays: [Warning] assignment makes pointer from integer without a cast
- How to print the array?
- “error: assignment to expression with array type error” when I assign a struct field (C)
- Getting “conflicting types for function” in C, why?
- How do you make an array of structs in C?
- Array versus linked-list
- C error: undefined reference to function, but it IS defined
- Is there a function to copy an array in C/C++?
- Reverse Contents in Array
- Why am I getting “array initializer must be an initializer list or string literal”?
- How do you pass a function as a parameter in C?
- How to make an array with a dynamic size? General usage of dynamic arrays (maybe pointers too)?
- Quick Way to Implement Dictionary in C
- waitpid, wnohang, wuntraced. How do I use these
- Warning: assignment from incompatible pointer type
- C: error: expected ‘)’ before ‘;’ token
- Data argument not used by format strings in C
- execv vs execvp, why just one of them require the exact file’s path?
- difference between
and - warning: initializer element is not computable at load time
- How to prevent multiple definitions in C?
- How can you print multiple variables inside a string using printf?
- Flushing buffers in C
- What are 0x01 and 0x80 representative of in C bitwise operations?
- Convert char array to string use C
- How to make parent wait for all child processes to finish?
- Undefined Reference issues using Semaphores
- What is time(NULL) in C?
- Use of cudamalloc(). Why the double pointer?
- C dynamically growing array
- Why should we check WIFEXITED after wait in order to kill child processes in Linux system call?
- Python: Can a function return an array and a variable?
- OpenGL — GL_LINE_LOOP —
- How to use EOF to run through a text file in C?
- Valgrind complains with “Invalid write of size 8”
- Expression must be a pointer to a complete object type using simple pointer arithmetic
- What does “request for member ‘*******’ in something not a structure or union” mean?
- Segmentation fault (core dumped) due to fgets – I think
- What does “request for member ‘*******’ in something not a structure or union” mean?
- Unknown ending signal when using debugger gdb
- Valgrind: invalid read of size 4 -> sigsegv, works fine without valgrind and in visual studio
- Is there a good Valgrind substitute for Windows?
- How to add an object to an array
- Difference between sizeof(char) and sizeof(char *)
- creating an array of structs in c++
- Why can’t we pass arrays to function by value?
- Assembly x86 – “leave” Instruction
- Undefined reference to main – collect2: ld returned 1 exit status
- Is there a way to have printf() properly print out an array (of floats, say)?
- How do you allow spaces to be entered using scanf?
- How does one represent the empty char?
- Optional arguments in C function
- Where is the
header file on Linux? Why can’t I find ? - What is the difference between %g and %f in C?
- Why is the sizeof(int) == sizeof(long)?
- Structure padding and packing
- Return array from function
- Passing string to a function in C – with or without pointers?
- Javascript call() & apply() vs bind()?
- warning: return makes pointer from integer without a cast but returns integer as desired
- Difference between char *argv[] and char **argv for the second argument to main()
- Dynamic vs static array in c
- The difference between char * and char[] [duplicate]
- How to format strings using printf() to get equal length in the output
- In C, what exactly happens when you pass a NULL pointer to strcmp()?
- lseek/write suddenly returns -1 with errno = 9 (Bad file descriptor)
- Should I use printf(“\n”) or putchar(‘\n’) to print a newline in C?
- error: struct has no member named X
- Constructor for structs in C
- write() to stdout and printf output not interleaved?
- Implicit function declarations in C
- Convert long long to string in C?
- Using pointer to char array, values in that array can be accessed?
- How can I create a dynamically sized array of structs?
- how to stop a loop arduino
- How to normalize a mantissa
- How to use shared memory with Linux in C
- When is it ok to use a global variable in C?