Hi ,
I have one buffer size is 50 bytes and reading 50 byte data from file
unsigned char bufffer[50];
read(fd,buffer,50); // Consider each byte numerical is value is zero.
printf("@@%s@@",buffer); // Here i will get @@@@ only.
But I want @@(50 zero)@@ as output(i have to use %c or %s only). If 25th byte numerical value is zero. It will print only 25 bytes only but i want print entire buffer if it has null terminal(ZERO) middle of the buffer also)
Any help !!