I have client.c and server.c programs. The client should send the characters from a to z and the server convert them in uppercase.
When I compile client.c I get this warnings:
client.c: In function ‘main’:
client.c:21:15: warning: passing argument 2 of ‘strcpy’ makes pointer from integer without a cast [-Wint-conversion]
In file included from client.c:4:0:
/usr/include/string.h:121:14: note: expected ‘const char * restrict’ but argument is of type ‘char’
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
Yes. Don't use strcpy like that. What you are actually telling the compiler is that you want to copy strings from memory locations 65, then 66, then 67, ...
Because strcpy works with pointers, not with character values. So the manifest constant 'a' gets translated into an integer equivalent to its ASCII code value (65), and strcpy attempts to copy characters starting at memory location 65. Which is generally hardware-protected low memory.
That's not a problem with shared memory or with client/server. You have failed at a basic C function. And C isn't very forgiving of failure.
Being persecuted doesn't in any way prove your righteousness or your beliefs. Many people get persecuted because they are repugnant or annoying. Or just because they can be.
A feeble attempt to tell you about our stuff that makes us money
professionally read, modify and write PDF files from Java