Ahmed Akhtar February 2016
What you are doing here is wrong:
char *buffer = "Name=Tom";
When you assign a string literal to a pointer it is stored as a
const char*, which cannot be modified, which is what you are trying to do later in your code.
Here, you first need to allocate memory to
buffer and then use
strcpy to copy the contents like: