You can’t assign arrays in C. You can copy them with the memcpy()
function, declared in <string.h>
:
int a[3];
int b[] = {1,2,3};
memcpy(&a, &b, sizeof a);
More Related Contents:
- Usage of uint_8, uint_16 and uint_32
- C Program that reads and Stores a series of integers
- What does the ??!??! operator do in C?
- Difference between int and char in getchar/fgetc and putchar/fputc?
- How do I return multiple values from a function in C?
- When should I use ampersand with scanf()
- How to read a line from the console in C?
- “#include” a text file in a C program as a char[]
- What exactly do C include guards do?
- ?: ternary conditional operator behaviour when leaving one expression empty
- what is the reason for explicitly declaring L or UL for long values
- Pre increment vs Post increment in array
- Xcode – Warning: Implicit declaration of function is invalid in C99
- How to print every executed line in GDB automatically until a given breakpoint is reached?
- What are C macros useful for?
- Global variables in C are static or not?
- Generating a uniform distribution of INTEGERS in C
- How garbage values are assigned to variables in c
- c popen won’t catch stderr
- Incompatible pointer types passing in _Generic macro
- variably modified array at file scope in C
- Does pthread_mutex_lock contains memory fence instruction? [duplicate]
- While-loop ignores scanf the second time
- When implementing an infinite loop, is there a difference in using while(1) vs for(;;) vs goto (in C)?
- what “inline __attribute__((always_inline))” means in the function?
- Is there a way to get warned about unused functions?
- pow() cast to integer, unexpected result
- How to get the size of a C function from inside a C program or with inline assembly?
- What’s the difference between “C system calls” and “C library routines”?
- Efficient 4×4 matrix multiplication (C vs assembly)