Click here to Skip to main content
16,008,954 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Repost Pin
led mike11-Dec-08 6:39
led mike11-Dec-08 6:39 
AnswerRe: UDP socket and GPRS Pin
Code-o-mat11-Dec-08 5:28
Code-o-mat11-Dec-08 5:28 
GeneralRe: UDP socket and GPRS Pin
nahitan11-Dec-08 5:54
nahitan11-Dec-08 5:54 
GeneralRe: UDP socket and GPRS Pin
Code-o-mat11-Dec-08 6:32
Code-o-mat11-Dec-08 6:32 
QuestionIgnoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 2:33
Mustafa Ismail Mustafa11-Dec-08 2:33 
GeneralRe: Ignoring \n in a binary file during reading Pin
Luc Pattyn11-Dec-08 2:36
sitebuilderLuc Pattyn11-Dec-08 2:36 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 2:46
Mustafa Ismail Mustafa11-Dec-08 2:46 
GeneralRe: Ignoring \n in a binary file during reading Pin
Stuart Dootson11-Dec-08 2:58
professionalStuart Dootson11-Dec-08 2:58 
Mustafa Ismail Mustafa wrote:
After this little beauty runs, I get buffer = "gsA" which is incorrect since I'm giving it 1000 characters to read. Opening the file manually (in windows, not linux where its supposed to be) shows me that there's an NUL right after those three characters (they're actually hex).


But what is there in buffer **after** the NULL? You're displaying buffer as a C string, so printf (or whatever) sees the NULL and presumes that's the end of the data in buffer. It probably *isn't*. The trouble is that the C string semantics get assumed for any char*, but those aren't the semantics you want.

You probably ought to iterate through buffer with a for-loop or something to see the data after the NULL.
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 3:04
Mustafa Ismail Mustafa11-Dec-08 3:04 
GeneralRe: Ignoring \n in a binary file during reading Pin
Stuart Dootson11-Dec-08 4:32
professionalStuart Dootson11-Dec-08 4:32 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 4:41
Mustafa Ismail Mustafa11-Dec-08 4:41 
GeneralRe: Ignoring \n in a binary file during reading Pin
Stuart Dootson11-Dec-08 6:50
professionalStuart Dootson11-Dec-08 6:50 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 10:34
Mustafa Ismail Mustafa11-Dec-08 10:34 
GeneralRe: Ignoring \n in a binary file during reading [modified] Pin
Stuart Dootson11-Dec-08 12:53
professionalStuart Dootson11-Dec-08 12:53 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 21:03
Mustafa Ismail Mustafa11-Dec-08 21:03 
GeneralRe: Ignoring \n in a binary file during reading Pin
Stuart Dootson11-Dec-08 21:11
professionalStuart Dootson11-Dec-08 21:11 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 21:44
Mustafa Ismail Mustafa11-Dec-08 21:44 
GeneralRe: Ignoring \n in a binary file during reading Pin
Stuart Dootson11-Dec-08 23:11
professionalStuart Dootson11-Dec-08 23:11 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa12-Dec-08 1:00
Mustafa Ismail Mustafa12-Dec-08 1:00 
GeneralRe: Ignoring \n in a binary file during reading Pin
Luc Pattyn11-Dec-08 3:07
sitebuilderLuc Pattyn11-Dec-08 3:07 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 3:18
Mustafa Ismail Mustafa11-Dec-08 3:18 
GeneralRe: Ignoring \n in a binary file during reading Pin
Luc Pattyn11-Dec-08 3:40
sitebuilderLuc Pattyn11-Dec-08 3:40 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 3:48
Mustafa Ismail Mustafa11-Dec-08 3:48 
GeneralRe: Ignoring \n in a binary file during reading Pin
Luc Pattyn11-Dec-08 4:32
sitebuilderLuc Pattyn11-Dec-08 4:32 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 4:45
Mustafa Ismail Mustafa11-Dec-08 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.