I want to write the integer 1 into the first byte and 0x35 to the second byte of a file descriptor using write (http://linux.about.com/library/cmd/blcmdl2_write.htm) but I get the following warning when I try the following:
write(fd, 1, 1);
write(fd, 0x35, 1);
source.c:29: warning: passing argument 2 of ‘write’ makes pointer from integer without a cast
source.c:30: warning: passing argument 2 of ‘write’ makes pointer from integer without a cast
You need to pass an address, so you’ll need a variable of some form or other.
If all you need is a single char:
Or use an array (this is generally more common):