DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 23rd October 2009
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default c++: writing to the *this pointer?

For context, I have a bitmapped field coming from a snmp reply that I can get from a printer. (panasonic workio DP-C264 - if anyone has technical documentation on it, I'd be glad to know!) I can information out of it with this line-
Code:
    vb.get_value( (unsigned char *)&Job, Job_len, sizeof(snmpjoblog ));
where Job is an instance of a class containing the what ints and char arrays I have detected: there are a lot of char[n] unknowns and int unknowns.
I'd like to roll the function to extract that info into the class, which would mean this:
Code:
    vb.get_value( (unsigned char *)this, Job_len, sizeof(snmpjoblog ));
As in, writing binary data over the top of the class itself. Now, when it compiled without error, I was suprised. But will this really work?
(I'm going to go try it with a utility I wrote, but I'd still like your input!)
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
 

Tags
*this, c++

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing Papers in FreeBSD kagayaki General software and network 4 14th July 2008 11:31 PM
FreeBSD 7.0 Writing large amount to USB Disc cause kernel panic pvree FreeBSD General 1 13th June 2008 02:50 AM


All times are GMT. The time now is 09:59 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick