Quote Originally Posted by EmaGht View Post
Sure i did. Everything is just fine untile the call to that LongMod.
Sometimes it works and sometimes the result get messed up, even if inside that function everything works properly.
If everything would be "just fine" then you hadn't got any problems at all! If you get - then something is NOT fine.
Besides:
  1. You mentioned some function, but haven't shown it.
  2. Your PotenzaModulare function produces memory leaks (a lot of malloc calls but there is no any free)
  3. Is there any very important reason for you to write plain C code avoiding all the advantages (like std and/or MFC container classes) that C++/VC++ give you?