[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cobalt-developers] Help: error when reading a file with C++
- Subject: [cobalt-developers] Help: error when reading a file with C++
- From: "Pascal Genest" <pascal.genest@xxxxxxxxx>
- Date: Tue Sep 24 00:25:01 2002
- List-id: Discussion Forum for developers on Sun Cobalt Networks products <cobalt-developers.list.cobalt.com>
Hello !
I use this code :
#include <iostream>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
void main ()
{
int fd = open("essai.txt", O_RDWR);
char * buf;
for (;read(fd, buf, 1);)
cout << *buf;
}
The program return a lot of « Z » and read not the file only on a
cobalt.
Thanks for your response
Pascal.