Salem wrote:
Working" != "Bug Free".
Just because it didn't crash immediately on trying printf((char *)&num); doesn't mean that you can always get away with it. It is plainly wrong even if it didn't crash in your specific case.
Your program was broken at "void main" and the rest is just mere accident as far as I can see.
Start with the first identified problem and work your way through them.
> the intresting part is that when I compile it shows no errors and no warnings,
If you add enough casts, you can compile any old rubbish.
This is no exception.
> The realy weird part is that it works just fine in 'debbug' mode,
> the problem is only in'release' mode,why is that?
Because your code has undefined behaviour, which means any combination of working, not quite working, reformatting your hard disk, crashing in a heap is permissible.
Getting different results from different builds is a sure sign of doing something wrong.
If your code is correct, the ONLY difference between debug and release should be performance, nothing else.
Salem,as I already told,I deleted lines 13 and 14 completley from my code and rebuilded,it still gave the same error,so you can't blame those lines in this particular case.
The problem was solved when I replaced atof with strimstring.
As about the difference between 'debbug' and 'release',it's
not the first time I encounter with it on this particular compiler(VC++ 6.0).
You will be surprised to hear that when I compiled one of my programs
with the warnings set to level 4(highest),it's actually found
60 warnings
in a header file that I recived with the compiler!
They acctualy wrote headers that collide with their own compiler!
Ancient dragon,the intresting thing that it's worked as is the moment I replaced atof,but thanks I'll fix the code.