Can't use Char buffer with strpbrk function ?

I have a fstream instance to read data from file.
And I keep on very confused.

1
2
3
4
5
6
7
8
9
10
BIN_BUFFER = new char [TAM_BUFFER];  (declared as char * BIN_BUFFER )
FILE.read (BIN_BUFFER , TAM_BUFFER);

 char * SCAN_DELIMITER="/r";
 char SCAN_DELIMITER_I='/r';
 char * pch;
 // want to know the first ocurrence 
 pch = strpbrk (BIN_BUFFER, SCAN_DELIMITER);  
 // want to last ocurrence 
 pch=strrchr(BIN_BUFFER,SCAN_DELIMITER_I);


I'm sure that I have /r into my text file, but both pch are null or strange.

What is I'm doing bad ?
I need urgent help.
Thanks
Do you mean '\r' (which is the escape sequence for carriage return) perhaps?

'/r' are two chars

be carefull that fstream doesn't eat them (binary mode!). Means \r\n -> \n
Last edited on
aaarrggssss !
Thank you
Last edited on
Topic archived. No new replies allowed.