So I am coding the skeleton for a larger program that will eventually be a message or IRC server.
The problem I am coming across is when trying to remove the end of line character from the input typed into to a character buffer by changing the value of '\n' to '\0'
The structure where the buffer is stored looks like this:
typedef struct{
pthread_t tid; //the id of the thread
char input[8192]; //message space of 2 to the 13th power
}thread_in;
thread_in user[3];
I then I made a temporary array pointer to my structure to make calling it easier.
char user_input[8192];
strncpy(user[num].input, user_input, 8192);
the problem is on the next line of code that give me the following warning:
Warning: assignment makes integer from pointer without a cast
This is the code:
user_input[strlen(user[num].input)-1] ="\0";
can someone point out why it thinks the assignment is to an integer since it is a array of characters.