Click here to Skip to main content
15,499,003 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Converting an image into jpeg format Pin
Vijjuuu.13-Apr-10 0:40
MemberVijjuuu.13-Apr-10 0:40 
GeneralRe: Converting an image into jpeg format Pin
CPallini13-Apr-10 0:47
mveCPallini13-Apr-10 0:47 
AnswerRe: Converting an image into jpeg format Pin
Cedric Moonen12-Apr-10 22:12
MemberCedric Moonen12-Apr-10 22:12 
AnswerRe: Converting an image into jpeg format Pin
CPallini12-Apr-10 22:21
mveCPallini12-Apr-10 22:21 
QuestionWindows date change event Pin
Vijjuuu.12-Apr-10 21:40
MemberVijjuuu.12-Apr-10 21:40 
AnswerRe: Windows date change event Pin
David Crow13-Apr-10 3:56
MemberDavid Crow13-Apr-10 3:56 
AnswerRe: Windows date change event Pin
KarstenK13-Apr-10 5:34
mveKarstenK13-Apr-10 5:34 
QuestionC - Application reusing memory locations that have been altered Pin
Member 259847812-Apr-10 14:35
MemberMember 259847812-Apr-10 14:35 
Long story, this isnt the exact use case but its a representation of the problem im having.


Lets say i then call a function that takes a Char*, i pass into this function "Hello!", upon arriving at this function the pointer lets say points to 0x55 containing "Hello!", this function then does bit manipulation on the Char*, so it now says "!olleH" at location 0x55

Now I again pass "Hello!" into the same function that takes a Char*, it goes directly to 0x55 and does the exact same bit manipulation, UNDOING the "encoding" and bringing the text back to "Hello!" rather than actually passing in a new instance of "Hello!" that i passed into it and encoding it to "!olleH" as it should.

Its as if the compiler is optimizing and any time it see's "Hello!" being passed through this function to just go straight to that memory location not knowing ive done bitwise things too it.

How do i stop this from happening or how can i trick the compiler into stopping this?

If i sprintf "Hello!" into a temporary buffer, and then print that, it works fine. But thats not a solution I can use unfortunately as there are hundreds if not thousands of lines that print "Hello!".

During my bitwise manipulation i've tried to create a new char, copy my text over to it, bit manipulate the new char, and then copy it back. But no luck, it just seems to point to that same location when i call the function.
AnswerRe: C - Application reusing memory locations that have been altered Pin
Garth J Lancaster12-Apr-10 16:09
professionalGarth J Lancaster12-Apr-10 16:09 
GeneralRe: C - Application reusing memory locations that have been altered Pin
Member 259847812-Apr-10 18:06
MemberMember 259847812-Apr-10 18:06 
GeneralRe: C - Application reusing memory locations that have been altered Pin
Tim Craig12-Apr-10 18:42
MemberTim Craig12-Apr-10 18:42 
GeneralRe: C - Application reusing memory locations that have been altered Pin
enhzflep13-Apr-10 3:03
Memberenhzflep13-Apr-10 3:03 
AnswerRe: C - Application reusing memory locations that have been altered Pin
Eugen Podsypalnikov12-Apr-10 21:34
MemberEugen Podsypalnikov12-Apr-10 21:34 
QuestionDLL in memory Pin
RomTibi12-Apr-10 9:53
MemberRomTibi12-Apr-10 9:53 
QuestionRe: DLL in memory Pin
David Crow12-Apr-10 11:11
MemberDavid Crow12-Apr-10 11:11 
AnswerRe: DLL in memory Pin
RomTibi13-Apr-10 7:35
MemberRomTibi13-Apr-10 7:35 
AnswerRe: DLL in memory Pin
David Crow13-Apr-10 7:40
MemberDavid Crow13-Apr-10 7:40 
GeneralRe: DLL in memory Pin
RomTibi13-Apr-10 7:55
MemberRomTibi13-Apr-10 7:55 
GeneralRe: DLL in memory Pin
David Crow13-Apr-10 7:57
MemberDavid Crow13-Apr-10 7:57 
GeneralRe: DLL in memory Pin
RomTibi13-Apr-10 7:59
MemberRomTibi13-Apr-10 7:59 
AnswerRe: DLL in memory Pin
«_Superman_»12-Apr-10 11:30
professional«_Superman_»12-Apr-10 11:30 
GeneralRe: DLL in memory Pin
RomTibi13-Apr-10 7:37
MemberRomTibi13-Apr-10 7:37 
AnswerRe: DLL in memory Pin
@Intersect☺™12-Apr-10 20:39
professional@Intersect☺™12-Apr-10 20:39 
GeneralRe: DLL in memory Pin
RomTibi13-Apr-10 7:38
MemberRomTibi13-Apr-10 7:38 
AnswerRe: DLL in memory Pin
Stephen Hewitt13-Apr-10 15:05
MemberStephen Hewitt13-Apr-10 15:05 

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.