I want to assign a struct value (that can be max 50 characters) from standard input but am getting the error:
Incompatible types when assigning to type 'char[50]' from type 'char *'
#include <stdio.h>
#include <stdlib.h>
#define MAX_LEN 50
struct msgbuf {
char mtext[MAX_LEN];
};
int main (int argc, char *argv)
{
struct msgbuf m;
char in[MAX_LEN];
scanf ("%s", in);
m.mtext = in;
}