My program is
#include <fcntl.h>
#include <unistd.h>
int main(void)
{
int fd;
ssize_t nread;
char buf[100];
/*open file for reading */
fd = open("marks.dat ", O_RDONLY);
/* read the data */
nread = read(fd, buf, 1024);
/*close the file */
printf("%s\n\n" ,buf);
close(fd);
}
And my marks.dat is
123 123 123 4 56 sas as fd faa a s d sf d!!f d fd f df df d(HERE FILE
ENDS)
Output is
123 123 123 4 56 sas as fd faa a s d sf d!!f d fd f df df d
Ȭ¿^äì·9 ÷·ž–ž± ¬Â¿XƒôÃú ·Å¾Â–ر¬¿ )Â…
I am unable to understand why these special symbols are coming
#include <fcntl.h>
#include <unistd.h>
int main(void)
{
int fd;
ssize_t nread;
char buf[100];
/*open file for reading */
fd = open("marks.dat ", O_RDONLY);
/* read the data */
nread = read(fd, buf, 1024);
/*close the file */
printf("%s\n\n" ,buf);
close(fd);
}
And my marks.dat is
123 123 123 4 56 sas as fd faa a s d sf d!!f d fd f df df d(HERE FILE
ENDS)
Output is
123 123 123 4 56 sas as fd faa a s d sf d!!f d fd f df df d
Ȭ¿^äì·9 ÷·ž–ž± ¬Â¿XƒôÃú ·Å¾Â–ر¬¿ )Â…
I am unable to understand why these special symbols are coming
Comment